From 680d7eaf43e1b784f4131eb968fb071e972fc6ba Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 21 Jul 2021 17:11:04 +0800 Subject: [PATCH] fix --- src/server/pegasus_server_write.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server/pegasus_server_write.cpp b/src/server/pegasus_server_write.cpp index 5ecdd18907..f41ca79f02 100644 --- a/src/server/pegasus_server_write.cpp +++ b/src/server/pegasus_server_write.cpp @@ -111,10 +111,12 @@ int pegasus_server_write::on_batched_writes(dsn::message_ex **requests, int coun } } - if (err == 0) { - err = _write_svc->batch_commit(_decree); - } else { - _write_svc->batch_abort(_decree, err); + if (dsn_likely(_put_rpc_batch.size() + _remove_rpc_batch.size() != 0)) { + if (err == 0) { + err = _write_svc->batch_commit(_decree); + } else { + _write_svc->batch_abort(_decree, err); + } } }