From ee0be88b99c1aff54b60b437df5a313c82f7bffb Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 8 May 2020 17:45:06 -0700 Subject: [PATCH] consistency check can use a UIDtoTag map at a different version from the keyservers which could result in missing entries --- fdbclient/SystemData.cpp | 4 ++-- fdbclient/SystemData.h | 2 +- fdbserver/workloads/ConsistencyCheck.actor.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fdbclient/SystemData.cpp b/fdbclient/SystemData.cpp index faa4ccd89a..52455e437a 100644 --- a/fdbclient/SystemData.cpp +++ b/fdbclient/SystemData.cpp @@ -83,7 +83,7 @@ const Value keyServersValue( const std::vector& srcTag, const std::vector result, const ValueRef& value, - std::vector& src, std::vector& dest ) { + std::vector& src, std::vector& dest, bool missingIsError ) { if (value.size() == 0) { src.clear(); dest.clear(); @@ -121,7 +121,7 @@ void decodeKeyServersValue( Standalone result, const ValueRef& v } std::sort(src.begin(), src.end()); std::sort(dest.begin(), dest.end()); - if(src.size() != srcTag.size() || dest.size() != destTag.size()) { + if(missingIsError && (src.size() != srcTag.size() || dest.size() != destTag.size())) { TraceEvent(SevError, "AttemptedToDecodeMissingTag"); for (const KeyValueRef kv : result) { Tag tag = decodeServerTagValue(kv.value); diff --git a/fdbclient/SystemData.h b/fdbclient/SystemData.h index 16c109e315..34e9d8f17c 100644 --- a/fdbclient/SystemData.h +++ b/fdbclient/SystemData.h @@ -58,7 +58,7 @@ const Value keyServersValue( const std::vector& destTag = std::vector()); // `result` must be the full result of getting serverTagKeys void decodeKeyServersValue( Standalone result, const ValueRef& value, - std::vector& src, std::vector& dest ); + std::vector& src, std::vector& dest, bool missingIsError = true ); // "\xff/storageCache/[[begin]]" := "[[vector]]" extern const KeyRangeRef storageCacheKeys; diff --git a/fdbserver/workloads/ConsistencyCheck.actor.cpp b/fdbserver/workloads/ConsistencyCheck.actor.cpp index 3fc061e709..9ad4cd60cc 100644 --- a/fdbserver/workloads/ConsistencyCheck.actor.cpp +++ b/fdbserver/workloads/ConsistencyCheck.actor.cpp @@ -669,7 +669,7 @@ struct ConsistencyCheckWorkload : TestWorkload Standalone UIDtoTagMap = wait( tr.getRange( serverTagKeys, CLIENT_KNOBS->TOO_MANY ) ); ASSERT( !UIDtoTagMap.more && UIDtoTagMap.size() < CLIENT_KNOBS->TOO_MANY ); - decodeKeyServersValue(UIDtoTagMap, keyLocations[shard].value, sourceStorageServers, destStorageServers); + decodeKeyServersValue(UIDtoTagMap, keyLocations[shard].value, sourceStorageServers, destStorageServers, false); //If the destStorageServers is non-empty, then this shard is being relocated state bool isRelocating = destStorageServers.size() > 0;