From 27d6ef8e60cdc4205e07f96430676e37593a4f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Tue, 8 Mar 2022 11:26:40 -0800 Subject: [PATCH] Rename mutable_cf_options to signify explicity copy (#9666) Summary: Signify explicit copy with comment and better name for variable `mutable_cf_options` Pull Request resolved: https://github.com/facebook/rocksdb/pull/9666 Reviewed By: riversand963 Differential Revision: D34680934 Pulled By: ezgicicek fbshipit-source-id: b64ef18725fe523835d14ceb4b29bcdfe493f8ed --- db/db_impl/db_impl_compaction_flush.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index e716bac9b..93de350c2 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -382,13 +382,14 @@ Status DBImpl::FlushMemTablesToOutputFiles( &earliest_write_conflict_snapshot, &snapshot_checker); const auto& bg_flush_arg = bg_flush_args[0]; ColumnFamilyData* cfd = bg_flush_arg.cfd_; - MutableCFOptions mutable_cf_options = *cfd->GetLatestMutableCFOptions(); + // intentional infrequent copy for each flush + MutableCFOptions mutable_cf_options_copy = *cfd->GetLatestMutableCFOptions(); SuperVersionContext* superversion_context = bg_flush_arg.superversion_context_; Status s = FlushMemTableToOutputFile( - cfd, mutable_cf_options, made_progress, job_context, superversion_context, - snapshot_seqs, earliest_write_conflict_snapshot, snapshot_checker, - log_buffer, thread_pri); + cfd, mutable_cf_options_copy, made_progress, job_context, + superversion_context, snapshot_seqs, earliest_write_conflict_snapshot, + snapshot_checker, log_buffer, thread_pri); return s; }