@@ -382,12 +382,6 @@ Operation::Result BaseOperation::KvTxnPut(const std::vector<sdk::KVPair>& kvs) {
382382 }
383383 }
384384
385- result.status = txn->PreCommit ();
386- if (!result.status .IsOK ()) {
387- LOG (ERROR ) << fmt::format (" pre commit transaction failed, error: {}" , result.status .ToString ());
388- goto end;
389- }
390-
391385 result.status = txn->Commit ();
392386 if (!result.status .IsOK ()) {
393387 LOG (ERROR ) << fmt::format (" commit transaction failed, error: {}" , result.status .ToString ());
@@ -458,12 +452,6 @@ Operation::Result BaseOperation::KvTxnBatchPut(const std::vector<sdk::KVPair>& k
458452 goto end;
459453 }
460454
461- result.status = txn->PreCommit ();
462- if (!result.status .IsOK ()) {
463- LOG (ERROR ) << fmt::format (" pre commit transaction failed, error: {}" , result.status .ToString ());
464- goto end;
465- }
466-
467455 result.status = txn->Commit ();
468456 if (!result.status .IsOK ()) {
469457 LOG (ERROR ) << fmt::format (" commit transaction failed, error: {}" , result.status .ToString ());
@@ -501,12 +489,6 @@ Operation::Result BaseOperation::KvTxnGet(const std::vector<std::string>& keys)
501489 }
502490 }
503491
504- result.status = txn->PreCommit ();
505- if (!result.status .IsOK ()) {
506- LOG (ERROR ) << fmt::format (" pre commit transaction failed, error: {}" , result.status .ToString ());
507- goto end;
508- }
509-
510492 result.status = txn->Commit ();
511493 if (!result.status .IsOK ()) {
512494 LOG (ERROR ) << fmt::format (" commit transaction failed, error: {}" , result.status .ToString ());
@@ -544,12 +526,6 @@ Operation::Result BaseOperation::KvTxnBatchGet(const std::vector<std::vector<std
544526 }
545527 }
546528
547- result.status = txn->PreCommit ();
548- if (!result.status .IsOK ()) {
549- LOG (ERROR ) << fmt::format (" pre commit transaction failed, error: {}" , result.status .ToString ());
550- goto end;
551- }
552-
553529 result.status = txn->Commit ();
554530 if (!result.status .IsOK ()) {
555531 LOG (ERROR ) << fmt::format (" commit transaction failed, error: {}" , result.status .ToString ());
0 commit comments