diff --git a/src/facade/reply_builder.cc b/src/facade/reply_builder.cc index d398ecbf8f98..8d372c3c4244 100644 --- a/src/facade/reply_builder.cc +++ b/src/facade/reply_builder.cc @@ -283,6 +283,10 @@ void MCReplyBuilder::SendMiss() { SendSimpleString("EN"); } +void MCReplyBuilder::SendDeleted() { + SendSimpleString(flag_.meta ? "HD" : "DELETED"); +} + void MCReplyBuilder::SendRaw(std::string_view str) { ReplyScope scope(this); WriteRef(str); @@ -422,7 +426,7 @@ void RedisReplyBuilder::SendScoredArray(ScoredArray arr, bool with_scores) { void RedisReplyBuilder::SendLabeledScoredArray(std::string_view arr_label, ScoredArray arr) { ReplyScope scope(this); - + StartArray(2); SendBulkString(arr_label); @@ -432,7 +436,6 @@ void RedisReplyBuilder::SendLabeledScoredArray(std::string_view arr_label, Score SendBulkString(str); SendDouble(score); } - } void RedisReplyBuilder::SendStored() { diff --git a/src/facade/reply_builder.h b/src/facade/reply_builder.h index 8c2bf7ee38c6..8b6a5a1a3926 100644 --- a/src/facade/reply_builder.h +++ b/src/facade/reply_builder.h @@ -172,6 +172,7 @@ class MCReplyBuilder : public SinkReplyBuilder { void SendClientError(std::string_view str); void SendNotFound(); void SendMiss(); + void SendDeleted(); void SendGetEnd(); void SendValue(std::string_view key, std::string_view value, uint64_t mc_ver, uint32_t mc_flag); diff --git a/src/server/generic_family.cc b/src/server/generic_family.cc index 17725d1c79b5..efe4fea221c2 100644 --- a/src/server/generic_family.cc +++ b/src/server/generic_family.cc @@ -1023,7 +1023,7 @@ void DeleteGeneric(CmdArgList args, const CommandContext& cmd_cntx) { if (del_cnt == 0) { mc_builder->SendNotFound(); } else { - mc_builder->SendSimpleString("DELETED"); + mc_builder->SendDeleted(); } } else { builder->SendLong(del_cnt); diff --git a/tests/dragonfly/memcache_meta.py b/tests/dragonfly/memcache_meta.py index 87bbd1fcf648..243339d319ea 100644 --- a/tests/dragonfly/memcache_meta.py +++ b/tests/dragonfly/memcache_meta.py @@ -28,3 +28,5 @@ def test_basic(df_server: DflyInstance): response = pool.meta_get(Key("key1"), flags=request_flags) assert isinstance(response, Success) assert pool.get("key2") is None + assert pool.delete("key1") + assert pool.delete("key1") is False