-
Notifications
You must be signed in to change notification settings - Fork 968
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: Fix test_network_disconnect_during_migration
test
#4224
Changes from all commits
a27b000
ed07dcd
55b2152
9abb449
c484542
cee3446
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,9 @@ JournalStreamer::JournalStreamer(journal::Journal* journal, Context* cntx) | |
} | ||
|
||
JournalStreamer::~JournalStreamer() { | ||
DCHECK_EQ(in_flight_bytes_, 0u); | ||
if (!cntx_->IsCancelled()) { | ||
DCHECK_EQ(in_flight_bytes_, 0u); | ||
} | ||
VLOG(1) << "~JournalStreamer"; | ||
} | ||
|
||
|
@@ -79,7 +81,9 @@ void JournalStreamer::Cancel() { | |
VLOG(1) << "JournalStreamer::Cancel"; | ||
waker_.notifyAll(); | ||
journal_->UnregisterOnChange(journal_cb_id_); | ||
WaitForInflightToComplete(); | ||
if (!cntx_->IsCancelled()) { | ||
WaitForInflightToComplete(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was about to write that maybe we should move |
||
} | ||
} | ||
|
||
size_t JournalStreamer::GetTotalBufferCapacities() const { | ||
|
@@ -215,8 +219,15 @@ void RestoreStreamer::Run() { | |
return; | ||
|
||
cursor = db_slice_->Traverse(pt, cursor, [&](PrimeTable::bucket_iterator it) { | ||
if (fiber_cancelled_) // Could be cancelled any time as Traverse may preempt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how can traverse preempt if we dont have the big value serialization merged yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the callback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which callback can preempt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by the way I think we can use snapshot_version_ instead of fiber_canceled_ because we always process them together There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
db_slice_->FlushChangeToEarlierCallbacks(0 /db_id always 0 for cluster/, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also WriteBucket(it); can yield There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so I think the if fiber_cancelled_ should be also after call to FlushChangeToEarlierCallbacks |
||
return; | ||
|
||
db_slice_->FlushChangeToEarlierCallbacks(0 /*db_id always 0 for cluster*/, | ||
DbSlice::Iterator::FromPrime(it), snapshot_version_); | ||
|
||
if (fiber_cancelled_) // Could have been cancelled in above call too | ||
return; | ||
|
||
WriteBucket(it); | ||
}); | ||
|
||
|
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.
How did we not trigger this before ? Or did we just deadlocked because
WaitForInFlightToCOmplete() would never progress
?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.
idk why we didn't trigger this before, but indeed this dead locks