mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-15 17:51:06 +00:00
parent
5ef63f41d2
commit
49781e8daf
3 changed files with 13 additions and 2 deletions
|
@ -114,6 +114,10 @@ TEST_F(DflyEngineTest, MultiEmpty) {
|
|||
|
||||
ASSERT_THAT(resp[0], ArrLen(0));
|
||||
ASSERT_FALSE(service_->IsShardSetLocked());
|
||||
|
||||
Run({"multi"});
|
||||
ASSERT_THAT(Run({"ping", "foo"}), RespEq("QUEUED"));
|
||||
EXPECT_THAT(Run({"exec"}), ElementsAre("foo"));
|
||||
}
|
||||
|
||||
TEST_F(DflyEngineTest, MultiSeq) {
|
||||
|
@ -178,6 +182,12 @@ TEST_F(DflyEngineTest, MultiConsistent) {
|
|||
ASSERT_FALSE(service_->IsShardSetLocked());
|
||||
}
|
||||
|
||||
TEST_F(DflyEngineTest, MultiWeirdCommands) {
|
||||
Run({"multi"});
|
||||
ASSERT_THAT(Run({"eval", "return 42", "0"}), RespEq("QUEUED"));
|
||||
EXPECT_THAT(Run({"exec"}), ElementsAre(IntArg(42)));
|
||||
}
|
||||
|
||||
TEST_F(DflyEngineTest, MultiRename) {
|
||||
RespVec resp = Run({"multi"});
|
||||
ASSERT_THAT(resp, RespEq("OK"));
|
||||
|
|
|
@ -853,7 +853,9 @@ void Service::Exec(CmdArgList args, ConnectionContext* cntx) {
|
|||
|
||||
cntx->transaction->SetExecCmd(scmd.descr);
|
||||
CmdArgList cmd_arg_list{str_list.data(), str_list.size()};
|
||||
cntx->transaction->InitByArgs(cntx->conn_state.db_index, cmd_arg_list);
|
||||
if (IsTransactional(scmd.descr)) {
|
||||
cntx->transaction->InitByArgs(cntx->conn_state.db_index, cmd_arg_list);
|
||||
}
|
||||
scmd.descr->Invoke(cmd_arg_list, cntx);
|
||||
if (rb->GetError())
|
||||
break;
|
||||
|
|
|
@ -975,7 +975,6 @@ bool Transaction::CancelInShard(EngineShard* shard) {
|
|||
// runs in engine-shard thread.
|
||||
ArgSlice Transaction::ShardArgsInShard(ShardId sid) const {
|
||||
DCHECK(!args_.empty());
|
||||
DCHECK_NOTNULL(EngineShard::tlocal());
|
||||
|
||||
// We can read unique_shard_cnt_ only because ShardArgsInShard is called after IsArmedInShard
|
||||
// barrier.
|
||||
|
|
Loading…
Reference in a new issue