ggyuchive commented on code in PR #3322:
URL: https://github.com/apache/kvrocks/pull/3322#discussion_r2657944435


##########
src/types/redis_string.cc:
##########
@@ -395,43 +395,38 @@ rocksdb::Status String::IncrByFloat(engine::Context &ctx, 
const std::string &use
 }
 
 rocksdb::Status String::MSet(engine::Context &ctx, const 
std::vector<StringPair> &pairs, StringMSetArgs args,
-                             bool *flag) {
-  if (flag != nullptr) {
-    *flag = false;
-  }
-
-  if (args.type != StringSetType::NONE) {
-    int exists = 0;
-    int key_count = static_cast<int>(pairs.size());
-    std::vector<Slice> keys;
-    keys.reserve(pairs.size());
-    for (const auto &pair : pairs) {
-      keys.emplace_back(pair.key);
-    }
-    auto s = Exists(ctx, keys, &exists);
-    if (!s.ok()) return s;
-    if ((args.type == StringSetType::NX && exists > 0) || (args.type == 
StringSetType::XX && exists < key_count)) {
-      return rocksdb::Status::OK();
-    }
-  }
+                             bool *flag = nullptr) {
+  if (flag) *flag = false;
 
   auto batch = storage_->GetWriteBatchBase();
   WriteBatchLogData log_data(kRedisString);
-  rocksdb::Status s = batch->PutLogData(log_data.Encode());
+  auto s = batch->PutLogData(log_data.Encode());

Review Comment:
   @PragmaTwice , you're right. This change has an issue in tx mode.
   ```
   127.0.0.1:6666> msetex 1 key1 value1
   (integer) 1
   127.0.0.1:6666> get key2
   (nil)
   127.0.0.1:6666> multi
   OK
   127.0.0.1:6666(TX)> msetex 2 key1 value100 key2 value200 xx
   QUEUED
   127.0.0.1:6666(TX)> exec
   1) (integer) 0
   127.0.0.1:6666> get key1
   "value100"
   127.0.0.1:6666>
   ```
   key1 must be value1 after commit. I will fix it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to