Slot migration cancel crash fix (#2934)

fix(cluster): crash #2928
This commit is contained in:
Borys 2024-04-19 14:31:42 +03:00 committed by GitHub
parent c42b3dc02f
commit 7666aae6dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 39 deletions

View file

@ -112,11 +112,12 @@ RestoreStreamer::~RestoreStreamer() {
}
void RestoreStreamer::Cancel() {
if (snapshot_version_ != 0) {
auto sver = snapshot_version_;
snapshot_version_ = 0; // to prevent double cancel in another fiber
if (sver != 0) {
fiber_cancellation_.Cancel();
db_slice_->UnregisterOnChange(snapshot_version_);
db_slice_->UnregisterOnChange(sver);
JournalStreamer::Cancel();
snapshot_version_ = 0;
}
}