From bc19f704551303b7cbbc9554bef5c28dcf44e3c0 Mon Sep 17 00:00:00 2001 From: tclinken Date: Fri, 1 May 2020 17:07:56 -0700 Subject: [PATCH 1/3] Move delayedHealthUpdateF declaration --- fdbrpc/FlowTransport.actor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fdbrpc/FlowTransport.actor.cpp b/fdbrpc/FlowTransport.actor.cpp index ccd762be91..6325a76452 100644 --- a/fdbrpc/FlowTransport.actor.cpp +++ b/fdbrpc/FlowTransport.actor.cpp @@ -437,12 +437,13 @@ ACTOR Future connectionKeeper( Reference self, .detail("ConnSet", (bool)conn); ASSERT_WE_THINK(FlowTransport::transport().getLocalAddress() != self->destination); + state Future delayedHealthUpdateF; state Optional firstConnFailedTime = Optional(); state int retryConnect = false; loop { try { - state Future delayedHealthUpdateF = Future(); + delayedHealthUpdateF = Future(); if (!conn) { // Always, except for the first loop with an incoming connection self->outgoingConnectionIdle = true; From 494d1d3518e1a8954074eef531a691bb8477283b Mon Sep 17 00:00:00 2001 From: tclinken Date: Fri, 1 May 2020 17:44:35 -0700 Subject: [PATCH 2/3] Fixed unused variable warning in atomicParallelRestore --- fdbclient/FileBackupAgent.actor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fdbclient/FileBackupAgent.actor.cpp b/fdbclient/FileBackupAgent.actor.cpp index 49bd98816d..ba7ec26113 100644 --- a/fdbclient/FileBackupAgent.actor.cpp +++ b/fdbclient/FileBackupAgent.actor.cpp @@ -4614,11 +4614,10 @@ public: // Similar to atomicRestore, only used in simulation test. // locks the database before discontinuing the backup and that same lock is then used while doing the restore. // the tagname of the backup must be the same as the restore. - ACTOR static Future atomicParallelRestore(FileBackupAgent* backupAgent, Database cx, Key tagName, + static Future atomicParallelRestore(FileBackupAgent* backupAgent, Database cx, Key tagName, Standalone> ranges, Key addPrefix, Key removePrefix) { - Version ver = wait(atomicRestore(backupAgent, cx, tagName, ranges, addPrefix, removePrefix, true)); - return Void(); + return success(atomicRestore(backupAgent, cx, tagName, ranges, addPrefix, removePrefix, true)); } }; From 943e8e7e842aba19be347780080fba65345b79d2 Mon Sep 17 00:00:00 2001 From: tclinken Date: Fri, 1 May 2020 20:15:31 -0700 Subject: [PATCH 3/3] More fixes for OPEN_FOR_IDE build --- fdbserver/CMakeLists.txt | 1 + fdbserver/RestoreMaster.actor.cpp | 1 - fdbserver/ServerDBInfo.actor.h | 101 ++++++++++++++++++ fdbserver/ServerDBInfo.h | 70 +----------- fdbserver/Status.actor.cpp | 6 +- ...kupAndParallelRestoreCorrectness.actor.cpp | 1 - 6 files changed, 106 insertions(+), 74 deletions(-) create mode 100644 fdbserver/ServerDBInfo.actor.h diff --git a/fdbserver/CMakeLists.txt b/fdbserver/CMakeLists.txt index 4bf4aa1c5c..75cc6fc68e 100644 --- a/fdbserver/CMakeLists.txt +++ b/fdbserver/CMakeLists.txt @@ -77,6 +77,7 @@ set(FDBSERVER_SRCS RestoreWorker.actor.cpp Resolver.actor.cpp ResolverInterface.h + ServerDBInfo.actor.h ServerDBInfo.h SimulatedCluster.actor.cpp SimulatedCluster.h diff --git a/fdbserver/RestoreMaster.actor.cpp b/fdbserver/RestoreMaster.actor.cpp index 881ba43951..2e31754255 100644 --- a/fdbserver/RestoreMaster.actor.cpp +++ b/fdbserver/RestoreMaster.actor.cpp @@ -193,7 +193,6 @@ ACTOR Future distributeRestoreSysInfo(Reference masterD ACTOR Future startProcessRestoreRequests(Reference self, Database cx) { state UID randomUID = deterministicRandom()->randomUniqueID(); state Standalone> restoreRequests = wait(collectRestoreRequests(cx)); - state int numTries = 0; state int restoreIndex = 0; TraceEvent("FastRestoreMasterWaitOnRestoreRequests", self->id()).detail("RestoreRequests", restoreRequests.size()); diff --git a/fdbserver/ServerDBInfo.actor.h b/fdbserver/ServerDBInfo.actor.h new file mode 100644 index 0000000000..f0e3b432dd --- /dev/null +++ b/fdbserver/ServerDBInfo.actor.h @@ -0,0 +1,101 @@ +/* + * ServerDBInfo.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2018 Apple Inc. and the FoundationDB project authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_SERVERDBINFO_ACTOR_G_H) +#define FDBSERVER_SERVERDBINFO_ACTOR_G_H +#include "fdbserver/ServerDBInfo.actor.g.h" +#elif !defined(FDBSERVER_SERVERDBINFO_ACTOR_H) +#define FDBSERVER_SERVERDBINFO_ACTOR_H +#define FDBSERVER_SERVERDBINFO_H +#pragma once + +#include "fdbserver/DataDistributorInterface.h" +#include "fdbserver/MasterInterface.h" +#include "fdbserver/LogSystemConfig.h" +#include "fdbserver/RatekeeperInterface.h" +#include "fdbserver/RecoveryState.h" +#include "fdbserver/LatencyBandConfig.h" +#include "fdbserver/WorkerInterface.actor.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +struct ServerDBInfo { + constexpr static FileIdentifier file_identifier = 13838807; + // This structure contains transient information which is broadcast to all workers for a database, + // permitting them to communicate with each other. It is not available to the client. This mechanism + // (see GetServerDBInfoRequest) is closely parallel to OpenDatabaseRequest for the client. + + UID id; // Changes each time any other member changes + ClusterControllerFullInterface clusterInterface; + ClientDBInfo client; // After a successful recovery, eventually proxies that communicate with it + Optional distributor; // The best guess of current data distributor. + MasterInterface master; // The best guess as to the most recent master, which might still be recovering + Optional ratekeeper; + std::vector resolvers; + DBRecoveryCount recoveryCount; // A recovery count from DBCoreState. A successful master recovery increments it twice; unsuccessful recoveries may increment it once. Depending on where the current master is in its recovery process, this might not have been written by the current master. + RecoveryState recoveryState; + LifetimeToken masterLifetime; // Used by masterserver to detect not being the currently chosen master + LocalityData myLocality; // (Not serialized) Locality information, if available, for the *local* process + LogSystemConfig logSystemConfig; + std::vector priorCommittedLogServers; // If !fullyRecovered and logSystemConfig refers to a new log system which may not have been committed to the coordinated state yet, then priorCommittedLogServers are the previous, fully committed generation which need to stay alive in case this recovery fails + Optional latencyBandConfig; + std::vector> storageCaches; + int64_t infoGeneration; + + ServerDBInfo() : recoveryCount(0), recoveryState(RecoveryState::UNINITIALIZED), logSystemConfig(0), infoGeneration(0) {} + + bool operator == (ServerDBInfo const& r) const { return id == r.id; } + bool operator != (ServerDBInfo const& r) const { return id != r.id; } + + template + void serialize( Ar& ar ) { + serializer(ar, id, clusterInterface, client, distributor, master, ratekeeper, resolvers, recoveryCount, recoveryState, masterLifetime, logSystemConfig, priorCommittedLogServers, latencyBandConfig, storageCaches, infoGeneration); + } +}; + +struct UpdateServerDBInfoRequest { + constexpr static FileIdentifier file_identifier = 9467438; + Standalone serializedDbInfo; + std::vector broadcastInfo; + ReplyPromise> reply; + + template + void serialize(Ar& ar) { + serializer(ar, serializedDbInfo, broadcastInfo, reply); + } +}; + +struct GetServerDBInfoRequest { + constexpr static FileIdentifier file_identifier = 9467439; + UID knownServerInfoID; + ReplyPromise reply; + + template + void serialize(Ar& ar) { + serializer(ar, knownServerInfoID, reply); + } +}; + + +ACTOR Future broadcastTxnRequest(TxnStateRequest req, int sendAmount, bool sendReply); + +ACTOR Future> broadcastDBInfoRequest(UpdateServerDBInfoRequest req, int sendAmount, Optional sender, bool sendReply); + +#include "flow/unactorcompiler.h" +#endif diff --git a/fdbserver/ServerDBInfo.h b/fdbserver/ServerDBInfo.h index a28c6323ae..e2eb4df0c4 100644 --- a/fdbserver/ServerDBInfo.h +++ b/fdbserver/ServerDBInfo.h @@ -22,74 +22,6 @@ #define FDBSERVER_SERVERDBINFO_H #pragma once -#include "fdbserver/DataDistributorInterface.h" -#include "fdbserver/MasterInterface.h" -#include "fdbserver/LogSystemConfig.h" -#include "fdbserver/RatekeeperInterface.h" -#include "fdbserver/RecoveryState.h" -#include "fdbserver/LatencyBandConfig.h" -#include "fdbserver/WorkerInterface.actor.h" - -struct ServerDBInfo { - constexpr static FileIdentifier file_identifier = 13838807; - // This structure contains transient information which is broadcast to all workers for a database, - // permitting them to communicate with each other. It is not available to the client. This mechanism - // (see GetServerDBInfoRequest) is closely parallel to OpenDatabaseRequest for the client. - - UID id; // Changes each time any other member changes - ClusterControllerFullInterface clusterInterface; - ClientDBInfo client; // After a successful recovery, eventually proxies that communicate with it - Optional distributor; // The best guess of current data distributor. - MasterInterface master; // The best guess as to the most recent master, which might still be recovering - Optional ratekeeper; - std::vector resolvers; - DBRecoveryCount recoveryCount; // A recovery count from DBCoreState. A successful master recovery increments it twice; unsuccessful recoveries may increment it once. Depending on where the current master is in its recovery process, this might not have been written by the current master. - RecoveryState recoveryState; - LifetimeToken masterLifetime; // Used by masterserver to detect not being the currently chosen master - LocalityData myLocality; // (Not serialized) Locality information, if available, for the *local* process - LogSystemConfig logSystemConfig; - std::vector priorCommittedLogServers; // If !fullyRecovered and logSystemConfig refers to a new log system which may not have been committed to the coordinated state yet, then priorCommittedLogServers are the previous, fully committed generation which need to stay alive in case this recovery fails - Optional latencyBandConfig; - std::vector> storageCaches; - int64_t infoGeneration; - - ServerDBInfo() : recoveryCount(0), recoveryState(RecoveryState::UNINITIALIZED), logSystemConfig(0), infoGeneration(0) {} - - bool operator == (ServerDBInfo const& r) const { return id == r.id; } - bool operator != (ServerDBInfo const& r) const { return id != r.id; } - - template - void serialize( Ar& ar ) { - serializer(ar, id, clusterInterface, client, distributor, master, ratekeeper, resolvers, recoveryCount, recoveryState, masterLifetime, logSystemConfig, priorCommittedLogServers, latencyBandConfig, storageCaches, infoGeneration); - } -}; - -struct UpdateServerDBInfoRequest { - constexpr static FileIdentifier file_identifier = 9467438; - Standalone serializedDbInfo; - std::vector broadcastInfo; - ReplyPromise> reply; - - template - void serialize(Ar& ar) { - serializer(ar, serializedDbInfo, broadcastInfo, reply); - } -}; - -struct GetServerDBInfoRequest { - constexpr static FileIdentifier file_identifier = 9467439; - UID knownServerInfoID; - ReplyPromise reply; - - template - void serialize(Ar& ar) { - serializer(ar, knownServerInfoID, reply); - } -}; - - -Future broadcastTxnRequest(TxnStateRequest const& req, int const& sendAmount, bool const& sendReply); - -Future> broadcastDBInfoRequest(UpdateServerDBInfoRequest const& req, int const& sendAmount, Optional const& sender, bool const& sendReply); +#include "fdbserver/ServerDBInfo.actor.h" #endif diff --git a/fdbserver/Status.actor.cpp b/fdbserver/Status.actor.cpp index c524ed946f..11f73f4ec7 100644 --- a/fdbserver/Status.actor.cpp +++ b/fdbserver/Status.actor.cpp @@ -974,9 +974,9 @@ ACTOR static Future recoveryStateStatusFetcher(WorkerDetails // TODO: time_in_recovery: 0.5 // time_in_state: 0.1 - TraceEventFields md = wait(activeGens); - if(md.size()) { - int activeGenerations = md.getInt("ActiveGenerations"); + TraceEventFields mdActiveGens = wait(activeGens); + if(mdActiveGens.size()) { + int activeGenerations = mdActiveGens.getInt("ActiveGenerations"); message["active_generations"] = activeGenerations; } diff --git a/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp b/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp index 55a235b86c..283a0d7210 100644 --- a/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp +++ b/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp @@ -335,7 +335,6 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { state bool extraTasks = false; state UID randomID = nondeterministicRandom()->randomUniqueID(); state int restoreIndex = 0; - state bool restoreDone = false; state ReadYourWritesTransaction tr2(cx); TraceEvent("BARW_Arguments")