mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-29 12:47:02 +00:00
commitlog_replayer: Ensure applied frozen_mutation is safe during apply
Fixes #5211 In79935df959replay apply-call was changed from one with no continuation to one with. But the frozen mutation arg was still just lambda local. Change to use do_with for this case as well. Message-Id: <20191203162606.1664-1-calle@scylladb.com> (cherry picked from commit56a5e0a251)
This commit is contained in:
@@ -276,7 +276,7 @@ future<> db::commitlog_replayer::impl::process(stats* s, commitlog::buffer_and_r
|
||||
}
|
||||
|
||||
auto shard = _db.local().shard_of(fm);
|
||||
return _db.invoke_on(shard, [this, cer = std::move(cer), &src_cm, rp, shard, s] (database& db) -> future<> {
|
||||
return _db.invoke_on(shard, [this, cer = std::move(cer), &src_cm, rp, shard, s] (database& db) mutable -> future<> {
|
||||
auto& fm = cer.mutation();
|
||||
// TODO: might need better verification that the deserialized mutation
|
||||
// is schema compatible. My guess is that just applying the mutation
|
||||
@@ -306,7 +306,9 @@ future<> db::commitlog_replayer::impl::process(stats* s, commitlog::buffer_and_r
|
||||
return db.apply_in_memory(m, cf, db::rp_handle(), db::no_timeout);
|
||||
});
|
||||
} else {
|
||||
return db.apply_in_memory(fm, cf.schema(), db::rp_handle(), db::no_timeout);
|
||||
return do_with(std::move(cer).mutation(), [&](const frozen_mutation& m) {
|
||||
return db.apply_in_memory(m, cf.schema(), db::rp_handle(), db::no_timeout);
|
||||
});
|
||||
}
|
||||
}).then_wrapped([s] (future<> f) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user