Skip to content

Immediate Persistence of DDL Changes#62

Draft
google-labs-jules[bot] wants to merge 1 commit intomainfrom
immediate-persistence-ddl-changes-10695699377852798114
Draft

Immediate Persistence of DDL Changes#62
google-labs-jules[bot] wants to merge 1 commit intomainfrom
immediate-persistence-ddl-changes-10695699377852798114

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Jan 12, 2026

This PR addresses the need for immediate persistence of schema changes (DDL operations) to ensure durability. It introduces a persist method to the KeyValueStore trait and implements it for file-based and in-memory stores. The QueryExecutor's DDL handlers now invoke this persistence mechanism after schema modifications. Additionally, tests were updated to align with the current ExecutionResult types.


PR created automatically by Jules for task 10695699377852798114 started by @ryancinsight

High-level PR Summary

This PR introduces immediate persistence for DDL (Data Definition Language) operations to ensure schema changes are durably written to disk. It adds a persist method to the KeyValueStore trait and implements it for both file-based and in-memory storage backends. The DDL handlers for CREATE INDEX and DROP TABLE operations now call persist() immediately after making schema modifications to act as a checkpoint. Test cases were also updated to handle the RankedResults variant of ExecutionResult.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 src/core/storage/engine/traits/mod.rs
2 src/core/storage/engine/implementations/in_memory.rs
3 src/core/storage/engine/implementations/file_storage/store.rs
4 src/core/query/executor/executor.rs
5 src/core/query/executor/ddl_handlers.rs
6 src/core/query/executor/tests/executor_tests.rs
⚠️ Inconsistent Changes Detected
File Path Warning
src/core/query/executor/tests/executor_tests.rs The test changes add handling for RankedResults which appears to be addressing a pre-existing test issue unrelated to the DDL persistence feature

Need help? Join our Discord

- Added `persist` method to `KeyValueStore` trait.
- Implemented `persist` for `SimpleFileKvStore` (delegating to `persistence::save_data_to_disk`) and `InMemoryKvStore` (no-op).
- Updated `QueryExecutor::persist_store` to call `store.persist()`.
- Enforced immediate persistence in `handle_create_table` and `handle_drop_table` to ensure schema durability.
- Updated `executor_tests` to handle `RankedResults` return type for Select queries.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@openhands-ai
Copy link

openhands-ai bot commented Jan 12, 2026

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Rust CI
    • Rust CI

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #62 at branch `immediate-persistence-ddl-changes-10695699377852798114`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on f800c40..ac62311

  Severity     Location     Issue     Delete  
High src/core/query/executor/ddl_handlers.rs:113 Method does not exist
High src/core/query/executor/ddl_handlers.rs:210 Method does not exist
✅ Files analyzed, no issues (5)

src/core/query/executor/executor.rs
src/core/query/executor/tests/executor_tests.rs
src/core/storage/engine/implementations/file_storage/store.rs
src/core/storage/engine/implementations/in_memory.rs
src/core/storage/engine/traits/mod.rs

// IndexManager::create_index typically handles its own persistence for index metadata.
// Persist schema changes and new index metadata immediately to ensure safety.
// This acts as a checkpoint for DDL operations.
self.persist()?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line calls self.persist() on a QueryExecutor<S> instance, but QueryExecutor does not have a persist() method. The persist() method was added to the KeyValueStore trait, not to QueryExecutor. This will cause a compilation error: 'no method named persist found for struct QueryExecutor<S> in the current scope'. The correct call should be self.persist_store()?; which is the wrapper method defined in executor.rs at line 224 that properly calls self.store.write()?.persist().


React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)


// Persist changes immediately to ensure safety.
// This acts as a checkpoint for DDL operations.
self.persist()?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line calls self.persist() on a QueryExecutor<S> instance, but QueryExecutor does not have a persist() method. The persist() method was added to the KeyValueStore trait, not to QueryExecutor. This will cause a compilation error: 'no method named persist found for struct QueryExecutor<S> in the current scope'. The correct call should be self.persist_store()?; which is the wrapper method defined in executor.rs at line 224 that properly calls self.store.write()?.persist().


React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants