From ed2fb65732e7905d3fbbb100d9a826fcd720846e Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Mon, 4 Feb 2019 14:18:31 +0000 Subject: [PATCH] commitlog_replayer: Bugfix: finding truncation positions uses local var ref "uuid" was ref:ed in a continuation. Works 99.9% of the time because the continuation is not actually delayed (and assuming we begin the checks with non-truncated (system) cf:s it works). But if we do delay continuation, the resulting cf map will be borked. Fixes #4187. Message-Id: <20190204141831.3387-1-calle@scylladb.com> (cherry picked from commit 9cadbaa96fd764142e7d42dd1c63d885ffb67f0a) --- db/commitlog/commitlog_replayer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/commitlog/commitlog_replayer.cc b/db/commitlog/commitlog_replayer.cc index 288759f99f..1cb6d43bf3 100644 --- a/db/commitlog/commitlog_replayer.cc +++ b/db/commitlog/commitlog_replayer.cc @@ -164,7 +164,7 @@ future<> db::commitlog_replayer::impl::init() { // Get all truncation records for the CF and initialize max rps if // present. Cannot do this on demand, as there may be no sstables to // mark the CF as "needed". - return db::system_keyspace::get_truncated_position(uuid).then([&map, &uuid](std::vector tpps) { + return db::system_keyspace::get_truncated_position(uuid).then([&map, uuid](std::vector tpps) { for (auto& p : tpps) { rlogger.trace("CF {} truncated at {}", uuid, p); auto& pp = map[p.shard_id()][uuid];