Skip to content

Commit

Permalink
chore; add test
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Oleshko <[email protected]>
  • Loading branch information
dranikpg committed Jul 17, 2024
1 parent 3d27f5f commit 41bac7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/server/cluster/cluster_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ TEST_F(ClusterFamilyTest, ClusterCrossSlot) {

EXPECT_THAT(Run({"MSET", "key", "value", "key2", "value2"}), ErrArg("CROSSSLOT"));
EXPECT_THAT(Run({"MGET", "key", "key2"}), ErrArg("CROSSSLOT"));
EXPECT_THAT(Run({"ZINTERSTORE", "key", "2", "key1", "key2"}), ErrArg("CROSSSLOT"));

EXPECT_EQ(Run({"MSET", "key{tag}", "value", "key2{tag}", "value2"}), "OK");
EXPECT_THAT(Run({"MGET", "key{tag}", "key2{tag}"}), RespArray(ElementsAre("value", "value2")));
Expand Down
9 changes: 1 addition & 8 deletions src/server/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ void Transaction::BuildShardIndex(const KeyIndex& key_index, std::vector<PerShar
unique_slot_checker_.Add(key);
ShardId sid = Shard(key, shard_data_.size());

VLOG(0) << i << " " << key;

unsigned step = i == key_index.bonus ? 1 : key_index.step;

shard_index[sid].key_step = step;
unsigned step = shard_index[sid].key_step = key_index.bonus ? 1 : key_index.step;
auto& slices = shard_index[sid].slices;
if (!slices.empty() && slices.back().second == i) {
slices.back().second = i + step;
Expand Down Expand Up @@ -280,9 +276,6 @@ void Transaction::InitByKeys(const KeyIndex& key_index) {
return;
}

VLOG(0) << "InitByKeys " << key_index.start << " " << key_index.end << " " << key_index.step
<< " -> " << key_index.NumArgs();

DCHECK_LT(key_index.start, full_args_.size());

// Stub transactions always operate only on single shard.
Expand Down

0 comments on commit 41bac7a

Please sign in to comment.