diff --git a/codis/pkg/utils/version.go b/codis/pkg/utils/version.go index 424aeb7498..ab0674f18d 100644 --- a/codis/pkg/utils/version.go +++ b/codis/pkg/utils/version.go @@ -1,6 +1,6 @@ package utils const ( - Version = "2018-11-04 16:22:35 +0800 @de1ad026e329561c22e2a3035fbfe89dc7fef764 @3.2.2-12-gde1ad026" - Compile = "2023-02-23 11:25:09 +0800 by go version go1.19.6 linux/amd64" + Version = "2024-03-14 16:55:09 +0800 @de1ad026e329561c22e2a3035fbfe89dc7fef764 @Pika 3.5.3" + Compile = "2024-03-14 16:55:09 +0800 by go version go1.19.6 linux/amd64" ) diff --git a/include/pika_repl_server_conn.h b/include/pika_repl_server_conn.h index 8c473a4258..f5414e3307 100644 --- a/include/pika_repl_server_conn.h +++ b/include/pika_repl_server_conn.h @@ -32,8 +32,6 @@ class PikaReplServerConn : public net::PbConn { const InnerMessage::InnerRequest::TrySync& try_sync_request, const std::shared_ptr& conn, InnerMessage::InnerResponse::TrySync* try_sync_response); - static void BuildConsensusMeta(const bool& reject, const std::vector& hints, const uint32_t& term, - InnerMessage::InnerResponse* response); static void HandleDBSyncRequest(void* arg); static void HandleBinlogSyncRequest(void* arg); diff --git a/src/pika_repl_server_conn.cc b/src/pika_repl_server_conn.cc index 9cc83ab91b..e9b945ca2e 100644 --- a/src/pika_repl_server_conn.cc +++ b/src/pika_repl_server_conn.cc @@ -222,23 +222,6 @@ bool PikaReplServerConn::TrySyncOffsetCheck(const std::shared_ptr& return true; } -void PikaReplServerConn::BuildConsensusMeta(const bool& reject, const std::vector& hints, - const uint32_t& term, InnerMessage::InnerResponse* response) { - InnerMessage::ConsensusMeta* consensus_meta = response->mutable_consensus_meta(); - consensus_meta->set_term(term); - consensus_meta->set_reject(reject); - if (!reject) { - return; - } - for (const auto& hint : hints) { - InnerMessage::BinlogOffset* offset = consensus_meta->add_hint(); - offset->set_filenum(hint.b_offset.filenum); - offset->set_offset(hint.b_offset.offset); - offset->set_term(hint.l_offset.term); - offset->set_index(hint.l_offset.index); - } -} - void PikaReplServerConn::HandleDBSyncRequest(void* arg) { std::unique_ptr task_arg(static_cast(arg)); const std::shared_ptr req = task_arg->req; diff --git a/src/storage/src/redis.cc b/src/storage/src/redis.cc index 3066a62759..e9a632c637 100644 --- a/src/storage/src/redis.cc +++ b/src/storage/src/redis.cc @@ -19,6 +19,7 @@ Redis::Redis(Storage* const s, const DataType& type) scan_cursors_store_->SetCapacity(5000); default_compact_range_options_.exclusive_manual_compaction = false; default_compact_range_options_.change_level = true; + default_write_options_.sync = true; handles_.clear(); } diff --git a/src/storage/src/redis_hashes.cc b/src/storage/src/redis_hashes.cc index 4d1c9bf6b7..d8b20c8b1a 100644 --- a/src/storage/src/redis_hashes.cc +++ b/src/storage/src/redis_hashes.cc @@ -209,7 +209,6 @@ Status RedisHashes::HDel(const Slice& key, const std::vector& field std::string meta_value; int32_t del_cnt = 0; int32_t version = 0; - ScopeRecordLock l(lock_mgr_, key); ScopeSnapshot ss(db_, &snapshot); read_options.snapshot = snapshot; Status s = db_->Get(read_options, handles_[0], key, &meta_value); @@ -357,7 +356,6 @@ Status RedisHashes::HGetallWithTTL(const Slice& key, std::vector* fv Status RedisHashes::HIncrby(const Slice& key, const Slice& field, int64_t value, int64_t* ret) { *ret = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; uint32_t statistic = 0; @@ -428,7 +426,6 @@ Status RedisHashes::HIncrby(const Slice& key, const Slice& field, int64_t value, Status RedisHashes::HIncrbyfloat(const Slice& key, const Slice& field, const Slice& by, std::string* new_value) { new_value->clear(); rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; uint32_t statistic = 0; @@ -606,7 +603,6 @@ Status RedisHashes::HMSet(const Slice& key, const std::vector& fvs) } rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; std::string meta_value; @@ -665,7 +661,6 @@ Status RedisHashes::HMSet(const Slice& key, const std::vector& fvs) Status RedisHashes::HSet(const Slice& key, const Slice& field, const Slice& value, int32_t* res) { rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; uint32_t statistic = 0; @@ -724,7 +719,6 @@ Status RedisHashes::HSet(const Slice& key, const Slice& field, const Slice& valu Status RedisHashes::HSetnx(const Slice& key, const Slice& field, const Slice& value, int32_t* ret) { rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; std::string meta_value; @@ -1160,7 +1154,6 @@ Status RedisHashes::PKRScanRange(const Slice& key_start, const Slice& key_end, c Status RedisHashes::Expire(const Slice& key, int32_t ttl) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedHashesMetaValue parsed_hashes_meta_value(&meta_value); @@ -1183,7 +1176,6 @@ Status RedisHashes::Expire(const Slice& key, int32_t ttl) { Status RedisHashes::Del(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedHashesMetaValue parsed_hashes_meta_value(&meta_value); @@ -1278,7 +1270,6 @@ bool RedisHashes::PKExpireScan(const std::string& start_key, int32_t min_timesta Status RedisHashes::Expireat(const Slice& key, int32_t timestamp) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedHashesMetaValue parsed_hashes_meta_value(&meta_value); @@ -1300,7 +1291,6 @@ Status RedisHashes::Expireat(const Slice& key, int32_t timestamp) { Status RedisHashes::Persist(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedHashesMetaValue parsed_hashes_meta_value(&meta_value); diff --git a/src/storage/src/redis_lists.cc b/src/storage/src/redis_lists.cc index e2d484b3e4..5f4bbd0cf0 100644 --- a/src/storage/src/redis_lists.cc +++ b/src/storage/src/redis_lists.cc @@ -234,7 +234,6 @@ Status RedisLists::LInsert(const Slice& key, const BeforeOrAfter& before_or_afte const std::string& value, int64_t* ret) { *ret = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { @@ -349,7 +348,6 @@ Status RedisLists::LPop(const Slice& key, int64_t count, std::vectorclear(); rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); @@ -392,7 +390,6 @@ Status RedisLists::LPop(const Slice& key, int64_t count, std::vector& values, uint64_t* ret) { *ret = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); uint64_t index = 0; int32_t version = 0; @@ -436,7 +433,6 @@ Status RedisLists::LPush(const Slice& key, const std::vector& value Status RedisLists::LPushx(const Slice& key, const std::vector& values, uint64_t* len) { *len = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); @@ -579,7 +575,6 @@ Status RedisLists::LRangeWithTTL(const Slice& key, int64_t start, int64_t stop, Status RedisLists::LRem(const Slice& key, int64_t count, const Slice& value, uint64_t* ret) { *ret = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { @@ -695,7 +690,6 @@ Status RedisLists::LRem(const Slice& key, int64_t count, const Slice& value, uin Status RedisLists::LSet(const Slice& key, int64_t index, const Slice& value) { uint32_t statistic = 0; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { @@ -724,7 +718,6 @@ Status RedisLists::LSet(const Slice& key, int64_t index, const Slice& value) { Status RedisLists::LTrim(const Slice& key, int64_t start, int64_t stop) { rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); uint32_t statistic = 0; std::string meta_value; @@ -786,7 +779,6 @@ Status RedisLists::RPop(const Slice& key, int64_t count, std::vectorclear(); rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); @@ -831,7 +823,6 @@ Status RedisLists::RPoplpush(const Slice& source, const Slice& destination, std: uint32_t statistic = 0; Status s; rocksdb::WriteBatch batch; - MultiScopeRecordLock l(lock_mgr_, {source.ToString(), destination.ToString()}); if (source.compare(destination) == 0) { std::string meta_value; s = db_->Get(default_read_options_, handles_[0], source, &meta_value); @@ -986,7 +977,6 @@ Status RedisLists::RPushx(const Slice& key, const std::vector& valu *len = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { @@ -1120,7 +1110,6 @@ Status RedisLists::PKRScanRange(const Slice& key_start, const Slice& key_end, co Status RedisLists::Expire(const Slice& key, int32_t ttl) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedListsMetaValue parsed_lists_meta_value(&meta_value); @@ -1143,7 +1132,6 @@ Status RedisLists::Expire(const Slice& key, int32_t ttl) { Status RedisLists::Del(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedListsMetaValue parsed_lists_meta_value(&meta_value); @@ -1237,7 +1225,6 @@ bool RedisLists::PKExpireScan(const std::string& start_key, int32_t min_timestam Status RedisLists::Expireat(const Slice& key, int32_t timestamp) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedListsMetaValue parsed_lists_meta_value(&meta_value); @@ -1259,7 +1246,6 @@ Status RedisLists::Expireat(const Slice& key, int32_t timestamp) { Status RedisLists::Persist(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedListsMetaValue parsed_lists_meta_value(&meta_value); diff --git a/src/storage/src/redis_sets.cc b/src/storage/src/redis_sets.cc index f76217eb32..97f1f716fa 100644 --- a/src/storage/src/redis_sets.cc +++ b/src/storage/src/redis_sets.cc @@ -208,7 +208,6 @@ rocksdb::Status RedisSets::SAdd(const Slice& key, const std::vector } rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; std::string meta_value; rocksdb::Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); @@ -365,7 +364,6 @@ rocksdb::Status RedisSets::SDiffstore(const Slice& destination, const std::vecto std::string meta_value; int32_t version = 0; - ScopeRecordLock l(lock_mgr_, destination); ScopeSnapshot ss(db_, &snapshot); read_options.snapshot = snapshot; std::vector vaild_sets; @@ -540,7 +538,6 @@ rocksdb::Status RedisSets::SInterstore(const Slice& destination, const std::vect std::string meta_value; int32_t version = 0; bool have_invalid_sets = false; - ScopeRecordLock l(lock_mgr_, destination); ScopeSnapshot ss(db_, &snapshot); read_options.snapshot = snapshot; std::vector vaild_sets; @@ -841,7 +838,6 @@ rocksdb::Status RedisSets::SPop(const Slice& key, std::vector* memb std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); uint64_t start_us = pstd::NowMicros(); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); @@ -935,7 +931,6 @@ rocksdb::Status RedisSets::SRandmember(const Slice& key, int32_t count, std::vec std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::vector targets; std::unordered_set unique; @@ -996,7 +991,6 @@ rocksdb::Status RedisSets::SRandmember(const Slice& key, int32_t count, std::vec rocksdb::Status RedisSets::SRem(const Slice& key, const std::vector& members, int32_t* ret) { *ret = 0; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); int32_t version = 0; uint32_t statistic = 0; @@ -1099,7 +1093,6 @@ rocksdb::Status RedisSets::SUnionstore(const Slice& destination, const std::vect std::string meta_value; int32_t version = 0; - ScopeRecordLock l(lock_mgr_, destination); ScopeSnapshot ss(db_, &snapshot); read_options.snapshot = snapshot; std::vector vaild_sets; @@ -1345,7 +1338,6 @@ rocksdb::Status RedisSets::PKRScanRange(const Slice& key_start, const Slice& key rocksdb::Status RedisSets::Expire(const Slice& key, int32_t ttl) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); rocksdb::Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedSetsMetaValue parsed_sets_meta_value(&meta_value); @@ -1368,7 +1360,6 @@ rocksdb::Status RedisSets::Expire(const Slice& key, int32_t ttl) { rocksdb::Status RedisSets::Del(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); rocksdb::Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedSetsMetaValue parsed_sets_meta_value(&meta_value); @@ -1462,7 +1453,6 @@ bool RedisSets::PKExpireScan(const std::string& start_key, int32_t min_timestamp rocksdb::Status RedisSets::Expireat(const Slice& key, int32_t timestamp) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); rocksdb::Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedSetsMetaValue parsed_sets_meta_value(&meta_value); @@ -1484,7 +1474,6 @@ rocksdb::Status RedisSets::Expireat(const Slice& key, int32_t timestamp) { rocksdb::Status RedisSets::Persist(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); rocksdb::Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedSetsMetaValue parsed_sets_meta_value(&meta_value); diff --git a/src/storage/src/redis_strings.cc b/src/storage/src/redis_strings.cc index dd4c63dbbb..329f2d869f 100644 --- a/src/storage/src/redis_strings.cc +++ b/src/storage/src/redis_strings.cc @@ -162,7 +162,6 @@ Status RedisStrings::PKPatternMatchDel(const std::string& pattern, int32_t* ret) Status RedisStrings::Append(const Slice& key, const Slice& value, int32_t* ret) { std::string old_value; *ret = 0; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&old_value); @@ -328,14 +327,12 @@ Status RedisStrings::BitOp(BitOpType op, const std::string& dest_key, const std: *ret = static_cast(dest_value.size()); StringsValue strings_value(Slice(dest_value.c_str(), max_len)); - ScopeRecordLock l(lock_mgr_, dest_key); return db_->Put(default_write_options_, dest_key, strings_value.Encode()); } Status RedisStrings::Decrby(const Slice& key, int64_t value, int64_t* ret) { std::string old_value; std::string new_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&old_value); @@ -526,7 +523,6 @@ Status RedisStrings::GetrangeWithValue(const Slice& key, int64_t start_offset, i } Status RedisStrings::GetSet(const Slice& key, const Slice& value, std::string* old_value) { - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(old_value); @@ -545,7 +541,6 @@ Status RedisStrings::GetSet(const Slice& key, const Slice& value, std::string* o Status RedisStrings::Incrby(const Slice& key, int64_t value, int64_t* ret) { std::string old_value; std::string new_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); char buf[32] = {0}; if (s.ok()) { @@ -589,7 +584,6 @@ Status RedisStrings::Incrbyfloat(const Slice& key, const Slice& value, std::stri if (StrToLongDouble(value.data(), value.size(), &long_double_by) == -1) { return Status::Corruption("Value is not a vaild float"); } - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&old_value); @@ -731,7 +725,6 @@ Status RedisStrings::MSetnx(const std::vector& kvs, int32_t* ret) { Status RedisStrings::Set(const Slice& key, const Slice& value) { StringsValue strings_value(value); - ScopeRecordLock l(lock_mgr_, key); return db_->Put(default_write_options_, key, strings_value.Encode()); } @@ -739,7 +732,6 @@ Status RedisStrings::Setxx(const Slice& key, const Slice& value, int32_t* ret, c bool not_found = true; std::string old_value; StringsValue strings_value(value); - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(old_value); @@ -768,7 +760,6 @@ Status RedisStrings::SetBit(const Slice& key, int64_t offset, int32_t on, int32_ return Status::InvalidArgument("offset < 0"); } - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &meta_value); if (s.ok() || s.IsNotFound()) { std::string data_value; @@ -819,14 +810,12 @@ Status RedisStrings::Setex(const Slice& key, const Slice& value, int32_t ttl) { if (s != Status::OK()) { return s; } - ScopeRecordLock l(lock_mgr_, key); return db_->Put(default_write_options_, key, strings_value.Encode()); } Status RedisStrings::Setnx(const Slice& key, const Slice& value, int32_t* ret, const int32_t ttl) { *ret = 0; std::string old_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&old_value); @@ -857,7 +846,6 @@ Status RedisStrings::Setvx(const Slice& key, const Slice& value, const Slice& ne const int32_t ttl) { *ret = 0; std::string old_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&old_value); @@ -889,7 +877,6 @@ Status RedisStrings::Setvx(const Slice& key, const Slice& value, const Slice& ne Status RedisStrings::Delvx(const Slice& key, const Slice& value, int32_t* ret) { *ret = 0; std::string old_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&old_value); @@ -917,7 +904,6 @@ Status RedisStrings::Setrange(const Slice& key, int64_t start_offset, const Slic return Status::InvalidArgument("offset < 0"); } - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &old_value); if (s.ok()) { int32_t timestamp = 0; @@ -1154,7 +1140,6 @@ Status RedisStrings::BitPos(const Slice& key, int32_t bit, int64_t start_offset, Status RedisStrings::PKSetexAt(const Slice& key, const Slice& value, int32_t timestamp) { StringsValue strings_value(value); - ScopeRecordLock l(lock_mgr_, key); strings_value.set_timestamp(timestamp); return db_->Put(default_write_options_, key, strings_value.Encode()); } @@ -1273,7 +1258,6 @@ Status RedisStrings::PKRScanRange(const Slice& key_start, const Slice& key_end, Status RedisStrings::Expire(const Slice& key, int32_t ttl) { std::string value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&value); @@ -1292,7 +1276,6 @@ Status RedisStrings::Expire(const Slice& key, int32_t ttl) { Status RedisStrings::Del(const Slice& key) { std::string value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&value); @@ -1383,7 +1366,6 @@ bool RedisStrings::PKExpireScan(const std::string& start_key, int32_t min_timest Status RedisStrings::Expireat(const Slice& key, int32_t timestamp) { std::string value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&value); @@ -1403,7 +1385,6 @@ Status RedisStrings::Expireat(const Slice& key, int32_t timestamp) { Status RedisStrings::Persist(const Slice& key) { std::string value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&value); @@ -1424,7 +1405,6 @@ Status RedisStrings::Persist(const Slice& key) { Status RedisStrings::TTL(const Slice& key, int64_t* timestamp) { std::string value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &value); if (s.ok()) { ParsedStringsValue parsed_strings_value(&value); diff --git a/src/storage/src/redis_zsets.cc b/src/storage/src/redis_zsets.cc index 4da415901f..becdf3f7e4 100644 --- a/src/storage/src/redis_zsets.cc +++ b/src/storage/src/redis_zsets.cc @@ -216,7 +216,6 @@ Status RedisZSets::ZPopMax(const Slice& key, const int64_t count, std::vectorclear(); rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { @@ -262,7 +261,6 @@ Status RedisZSets::ZPopMin(const Slice& key, const int64_t count, std::vectorclear(); rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); std::string meta_value; Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { @@ -320,7 +318,6 @@ Status RedisZSets::ZAdd(const Slice& key, const std::vector& score_ int32_t version = 0; std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { bool vaild = true; @@ -483,7 +480,6 @@ Status RedisZSets::ZIncrby(const Slice& key, const Slice& member, double increme int32_t version = 0; std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -766,7 +762,6 @@ Status RedisZSets::ZRem(const Slice& key, const std::vector& member std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -815,7 +810,6 @@ Status RedisZSets::ZRemrangebyrank(const Slice& key, int32_t start, int32_t stop uint32_t statistic = 0; std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -871,7 +865,6 @@ Status RedisZSets::ZRemrangebyscore(const Slice& key, double min, double max, bo uint32_t statistic = 0; std::string meta_value; rocksdb::WriteBatch batch; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -1134,7 +1127,6 @@ Status RedisZSets::ZUnionstore(const Slice& destination, const std::vector member_score_map; Status s; @@ -1231,7 +1223,6 @@ Status RedisZSets::ZInterstore(const Slice& destination, const std::vectorGet(default_read_options_, key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -1502,7 +1491,6 @@ Status RedisZSets::Expire(const Slice& key, int32_t ttl) { Status RedisZSets::Del(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -1596,7 +1584,6 @@ bool RedisZSets::PKExpireScan(const std::string& start_key, int32_t min_timestam Status RedisZSets::Expireat(const Slice& key, int32_t timestamp) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value); @@ -1797,7 +1784,6 @@ Status RedisZSets::PKRScanRange(const Slice& key_start, const Slice& key_end, co Status RedisZSets::Persist(const Slice& key) { std::string meta_value; - ScopeRecordLock l(lock_mgr_, key); Status s = db_->Get(default_read_options_, handles_[0], key, &meta_value); if (s.ok()) { ParsedZSetsMetaValue parsed_zsets_meta_value(&meta_value);