-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete all dag block in sync dag store to protect the blocks not int … #4165
Conversation
WalkthroughThis update enhances the block store functionality by introducing methods for bulk deletion of absent blocks in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant InnerSyncTask
participant SyncDagStore
participant AbsentDagBlockStoreWriter
User->>InnerSyncTask: Detect fork
InnerSyncTask->>SyncDagStore: delete_all_dag_sync_block()
SyncDagStore->>AbsentDagBlockStoreWriter: delete_all_absent_block()
AbsentDagBlockStoreWriter-->>SyncDagStore: Confirmation of deletion
SyncDagStore-->>InnerSyncTask: Confirmation of sync store cleared
InnerSyncTask-->>User: Sync state updated
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- sync/src/store/sync_absent_ancestor.rs (2 hunks)
- sync/src/store/sync_dag_store.rs (1 hunks)
- sync/src/tasks/inner_sync_task.rs (1 hunks)
Additional comments not posted (3)
sync/src/store/sync_dag_store.rs (1)
153-155
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that all calls to
delete_all_dag_sync_block
are correctly implemented in the codebase.sync/src/store/sync_absent_ancestor.rs (1)
192-196
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that all calls to
delete_all_absent_block
are correctly implemented in the codebase.Verification successful
Usage of
delete_all_absent_block
verified.The method
delete_all_absent_block
is correctly implemented and utilized in the codebase.
sync/src/store/sync_dag_store.rs
: Verified usage.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all method calls to `delete_all_absent_block` in the codebase. # Test: Search for the method usage. Expect: Only occurrences of the new method. rg --type rust -A 5 $'delete_all_absent_block'Length of output: 1065
sync/src/tasks/inner_sync_task.rs (1)
189-190
: LGTM! But verify the method usage in the codebase.The code changes are approved.
However, ensure that all calls to
delete_all_dag_sync_block
are correctly implemented in the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- sync/src/store/tests.rs (1 hunks)
Additional comments not posted (3)
sync/src/store/tests.rs (3)
187-188
: Ensure iterator is not empty before deletion.The assertion checks that the iterator contains elements before performing the deletion operation. This is a good practice to validate the initial state.
190-191
: Perform bulk deletion of DAG blocks.The
delete_all_dag_sync_block
method is called to remove all entries from the store. This ensures that the store is emptied as intended.
192-193
: Ensure iterator is empty after deletion.The assertion checks that the iterator yields no elements after the deletion operation. This validates that the deletion was successful.
e02fe48
to
95a41df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- sync/src/store/sync_absent_ancestor.rs (2 hunks)
- sync/src/store/sync_dag_store.rs (1 hunks)
- sync/src/store/tests.rs (1 hunks)
- sync/src/tasks/inner_sync_task.rs (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- sync/src/store/sync_absent_ancestor.rs
- sync/src/store/sync_dag_store.rs
- sync/src/store/tests.rs
- sync/src/tasks/inner_sync_task.rs
…he blue fork
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information
Summary by CodeRabbit
New Features
SyncDagStore
to clear all absent blocks, improving data integrity.Tests
sync_dag_store
, confirming the functionality of the new deletion methods.