-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: set SlaveNode to DBSync status before commit bgsave task #2798
fix: set SlaveNode to DBSync status before commit bgsave task #2798
Conversation
WalkthroughThe primary change involves simplifying the Changes
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 Configration 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 (1)
- src/pika_repl_server_conn.cc (1 hunks)
Additional comments not posted (1)
src/pika_repl_server_conn.cc (1)
288-290
: LGTM! Ensure the synchronization logic is unaffected.The removal of the redundant call to
TryDBSync
is correct as it eliminates potential inefficiencies. Verify that this change does not impact the synchronization behavior.Verification successful
The removal of the redundant
TryDBSync
call inHandleDBSyncRequest
is correct.The remaining call to
TryDBSync
should be sufficient to handle the synchronization logic, as it ensures the database synchronization process is initiated correctly. The change eliminates unnecessary redundancy, which can improve efficiency.
- Ensure the synchronization logic is validated through testing to confirm no side effects.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the behavior of HandleDBSyncRequest after removing redundant TryDBSync call. # Test: Search for the function usage to understand the impact of the change. rg --type cpp -A 10 'HandleDBSyncRequest'Length of output: 2231
Script:
#!/bin/bash # Description: Gather context around the TryDBSync function and its usage within the repository. # Find the definition of TryDBSync function rg --type cpp -A 10 'TryDBSync' # Find all calls to TryDBSync in the repository rg --type cpp 'TryDBSync'Length of output: 8223
Co-authored-by: cheniujh <1271435567@qq.com>
…ndation#2798) Co-authored-by: cheniujh <1271435567@qq.com>
…ndation#2798) Co-authored-by: cheniujh <1271435567@qq.com>
这个PR修复了 Issue #2795 。
具体地,调换了两行代码的执行顺序。确保在Master端的SlaveNode会在提交bgsave任务开始前就进入DBSync状态(暂停BInlog的Purge),以确保bgsave执行时所基于的binlog(增量续传的起始点)不会在某些极端情况下被purge掉。
This PR fixes Issue #2795.
Specifically, it changes the execution order of two lines of code to ensure that the SlaveNode on the Master side enters the DBSync state (pausing Binlog purge) before the bgsave task begins. This ensures that the binlog, which serves as the starting point for incremental replication, is not purged in extreme cases during the execution of bgsave.