Merge pull request #5441 from xis19/master

Refactor ApplyMetadataMutation for better readability
This commit is contained in:
Trevor Clinkenbeard 2021-08-24 18:42:18 -07:00 committed by GitHub
commit 5d84ffe019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 903 additions and 715 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,22 +22,27 @@
#define FDBSERVER_APPLYMETADATAMUTATION_H
#pragma once
#include "fdbclient/MutationList.h"
#include "fdbclient/SystemData.h"
#include "fdbclient/BackupAgent.actor.h"
#include "fdbclient/MutationList.h"
#include "fdbclient/Notified.h"
#include "fdbclient/SystemData.h"
#include "fdbserver/IKeyValueStore.h"
#include "fdbserver/LogSystem.h"
#include "fdbserver/LogProtocolMessage.h"
#include "fdbserver/LogSystem.h"
#include "fdbserver/ProxyCommitData.actor.h"
inline bool isMetadataMutation(MutationRef const& m) {
// FIXME: This is conservative - not everything in system keyspace is necessarily processed by
// applyMetadataMutations
return (m.type == MutationRef::SetValue && m.param1.size() && m.param1[0] == systemKeys.begin[0] &&
!m.param1.startsWith(nonMetadataSystemKeys.begin)) ||
(m.type == MutationRef::ClearRange && m.param2.size() > 1 && m.param2[0] == systemKeys.begin[0] &&
!nonMetadataSystemKeys.contains(KeyRangeRef(m.param1, m.param2)));
if (m.type == MutationRef::SetValue) {
return m.param1.size() && m.param1[0] == systemKeys.begin[0] &&
!m.param1.startsWith(nonMetadataSystemKeys.begin);
} else if (m.type == MutationRef::ClearRange) {
return m.param2.size() > 1 && m.param2[0] == systemKeys.begin[0] &&
!nonMetadataSystemKeys.contains(KeyRangeRef(m.param1, m.param2));
} else {
return false;
}
}
Reference<StorageInfo> getStorageInfo(UID id,