From 7cd5ef711d854d22cf0944f7650db4a394a6d7f7 Mon Sep 17 00:00:00 2001 From: Jingyu Zhou Date: Fri, 1 Apr 2022 14:23:03 -0700 Subject: [PATCH] Fix test failure to BlobGranule due to missing private mutations The change feed metadata mutations use \xff\x02/feed/ prefix, which was not considered as "metadata mutations", thus not sent to the resolvers. This makes the private mutation generation not possible for change feed if the knob PROXY_USE_RESOLVER_PRIVATE_MUTATIONS is on. Fix by making it a metadata mutation. --- fdbserver/ApplyMetadataMutation.cpp | 1 + fdbserver/ApplyMetadataMutation.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fdbserver/ApplyMetadataMutation.cpp b/fdbserver/ApplyMetadataMutation.cpp index 53d754ec6e..1bd7a02331 100644 --- a/fdbserver/ApplyMetadataMutation.cpp +++ b/fdbserver/ApplyMetadataMutation.cpp @@ -357,6 +357,7 @@ private: } toCommit->addTags(allSources); } + TraceEvent(SevDebug, "SendingPrivatized_ChangeFeed", dbgid).detail("M", privatized); toCommit->writeTypedMessage(privatized); } } diff --git a/fdbserver/ApplyMetadataMutation.h b/fdbserver/ApplyMetadataMutation.h index 90c03ede77..d4e47e0946 100644 --- a/fdbserver/ApplyMetadataMutation.h +++ b/fdbserver/ApplyMetadataMutation.h @@ -72,8 +72,9 @@ inline bool isMetadataMutation(MutationRef const& m) { // FIXME: This is conservative - not everything in system keyspace is necessarily processed by // applyMetadataMutations if (m.type == MutationRef::SetValue) { - return m.param1.size() && m.param1[0] == systemKeys.begin[0] && - !m.param1.startsWith(nonMetadataSystemKeys.begin); + return (m.param1.size() && m.param1[0] == systemKeys.begin[0] && + !m.param1.startsWith(nonMetadataSystemKeys.begin)) || + m.param1.startsWith(changeFeedPrefix); } else if (m.type == MutationRef::ClearRange) { return m.param2.size() > 1 && m.param2[0] == systemKeys.begin[0] && !nonMetadataSystemKeys.contains(KeyRangeRef(m.param1, m.param2));