Skip to content
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: replication error message and scan command yield #4665

Merged
merged 3 commits into from
Feb 27, 2025
Merged

fix: replication error message and scan command yield #4665

merged 3 commits into from
Feb 27, 2025

Conversation

kostasrim
Copy link
Contributor

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@kostasrim
Copy link
Contributor Author

@kostasrim kostasrim self-assigned this Feb 26, 2025
@kostasrim kostasrim requested a review from romange February 26, 2025 15:56
clean up
Signed-off-by: kostas <kostas@dragonflydb.io>
journal::JournalFlushGuard journal_flush_guard(op_args.shard->journal());
cur = prime_table->Traverse(
cur, [&](PrimeIterator it) { cnt += ScanCb(op_args, it, scan_opts, vec); });
break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be fine. We can still over spin a little bit, because the called of OpScan does not return unless:

 677     // Break after kMaxScanTimeMs.                                                                  
 678     uint64_t time_now_ms = GetCurrentTimeMs();                                                      
 679     if (time_now_ms > db_cntx.time_now_ms + kMaxScanTimeMs) {                                       
 680       break;                                                                                        
 681     } 

or when the limit is reached. Basically, our worse latency is now the timeout (as opposed to OpScan potentially iterate the whole db table which would be unbounded time depending on the shard size)

journal::JournalFlushGuard journal_flush_guard(op_args.shard->journal());
cur = prime_table->Traverse(
cur, [&](PrimeIterator it) { cnt += ScanCb(op_args, it, scan_opts, vec); });
break;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this can be inside the while condition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. I did not want to make the expression big so I opted in for an if statement 🤷

One sec will address this.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@kostasrim kostasrim requested a review from adiholden February 27, 2025 07:30
@kostasrim
Copy link
Contributor Author

@kostasrim kostasrim merged commit ad062a3 into main Feb 27, 2025
15 checks passed
@kostasrim kostasrim deleted the kpr19 branch February 27, 2025 09:52
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.

None yet

2 participants