diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 743762d93280..7b0dc27468ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: ninja src/all ccache --show-stats echo Run ctest -V -L DFLY - #GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1 + GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1 ./tiered_storage_test GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY ./dragonfly_test --gtest_repeat=10 ./multi_test --multi_exec_mode=2 --gtest_repeat=10 diff --git a/src/server/common.h b/src/server/common.h index 7f7a0e836903..280394191753 100644 --- a/src/server/common.h +++ b/src/server/common.h @@ -51,9 +51,9 @@ class Transaction; class EngineShard; struct KeyLockArgs { - DbIndex db_index; + DbIndex db_index = 0; ArgSlice args; - unsigned key_step; + unsigned key_step = 1; }; // Describes key indices. diff --git a/src/server/debugcmd.cc b/src/server/debugcmd.cc index dad58b5cbba8..59b113fc3575 100644 --- a/src/server/debugcmd.cc +++ b/src/server/debugcmd.cc @@ -353,6 +353,7 @@ void DebugCmd::PopulateRangeFiber(uint64_t from, uint64_t len, std::string_view void DebugCmd::Inspect(string_view key) { EngineShardSet& ess = *shard_set; ShardId sid = Shard(key, ess.size()); + VLOG(1) << "DebugCmd::Inspect " << key; auto cb = [&]() -> ObjInfo { auto& db_slice = EngineShard::tlocal()->db_slice(); @@ -383,7 +384,9 @@ void DebugCmd::Inspect(string_view key) { KeyLockArgs lock_args; lock_args.args = ArgSlice{&key, 1}; + lock_args.key_step = 1; lock_args.db_index = cntx_->db_index(); + if (!db_slice.CheckLock(IntentLock::EXCLUSIVE, lock_args)) { oinfo.lock_status = db_slice.CheckLock(IntentLock::SHARED, lock_args) ? ObjInfo::S : ObjInfo::X; diff --git a/src/server/server_family.cc b/src/server/server_family.cc index 06ac8874b613..f1b5c7b0e8fa 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -494,7 +494,7 @@ fibers::future ServerFamily::Load(const std::string& load_path) // Check all paths are valid. for (const auto& path : paths) { error_code ec; - fs::canonical(path, ec); + auto canonical_path = fs::canonical(path, ec); if (ec) { LOG(ERROR) << "Error loading " << load_path << " " << ec.message(); fibers::promise ec_promise; diff --git a/src/server/transaction.cc b/src/server/transaction.cc index 7c8fb55dc7b3..8665f3f17d97 100644 --- a/src/server/transaction.cc +++ b/src/server/transaction.cc @@ -666,7 +666,12 @@ OpStatus Transaction::ScheduleSingleHop(RunnableType cb) { CHECK_GE(DecreaseRunCnt(), 1u); } }; - shard_set->Add(unique_shard_id_, std::move(schedule_cb)); // serves as a barrier. + + if (coordinator_index_ == unique_shard_id_) { + schedule_cb(); + } else { + shard_set->Add(unique_shard_id_, std::move(schedule_cb)); // serves as a barrier. + } } else { // This transaction either spans multiple shards and/or is multi.