Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fdbserver/AccumulativeChecksumUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "fdbserver/AccumulativeChecksumUtil.h"
#include "fdbserver/Knobs.h"
#include "fmt/format.h"

void updateMutationWithAcsAndAddMutationToAcsBuilder(std::shared_ptr<AccumulativeChecksumBuilder> acsBuilder,
MutationRef& mutation,
Expand Down Expand Up @@ -316,7 +317,7 @@ uint64_t AccumulativeChecksumValidator::getAndClearTotalAddedMutations() {
}

TEST_CASE("noSim/AccumulativeChecksum/MutationRef") {
printf("testing MutationRef encoding/decoding\n");
fmt::println("testing MutationRef encoding/decoding");
MutationRef m(MutationRef::SetValue, "TestKey"_sr, "TestValue"_sr);
m.setAccumulativeChecksumIndex(512);
BinaryWriter wr(AssumeVersion(ProtocolVersion::withMutationChecksum()));
Expand All @@ -331,7 +332,7 @@ TEST_CASE("noSim/AccumulativeChecksum/MutationRef") {

rd >> de;

printf("Deserialized mutation: %s\n", de.toString().c_str());
fmt::println("Deserialized mutation: {}", de.toString());

if (de.type != m.type || de.param1 != m.param1 || de.param2 != m.param2) {
TraceEvent(SevError, "MutationMismatch")
Expand Down
5 changes: 3 additions & 2 deletions fdbserver/BackupPartitionMap.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "fdbserver/BackupPartitionMap.actor.h"
#include "fdbserver/DDShardTracker.h"
#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

std::string serializePartitionListJSON(PartitionMap const& partitionMap) {
Expand Down Expand Up @@ -244,8 +245,8 @@ TEST_CASE("/BackupPartitionMap/calculateBackupPartitionKeyRanges/MultipleSmallSh
KeyRangeMap<ShardTrackedData> shards(defaultData);

for (int i = 0; i < 1000; i++) {
Key start = Key(format("shard%04d", i));
Key end = (i == 999) ? normalKeys.end : Key(format("shard%04d", i + 1));
Key start = Key(fmt::format("shard{:04}", i));
Key end = (i == 999) ? normalKeys.end : Key(fmt::format("shard{:04}", i + 1));

ShardTrackedData data;
StorageMetrics metrics;
Expand Down
5 changes: 3 additions & 2 deletions fdbserver/BackupWorker.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "flow/IRandom.h"
#include "fdbclient/Tracing.h"
#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

#define SevDebugMemory SevVerbose
Expand Down Expand Up @@ -461,7 +462,7 @@ ACTOR static Future<bool> shouldBackupWorkerExitEarly(BackupData* self) {
TraceEvent e("BackupWorkerGotStartKey", self->myId);
int i = 1;
for (auto [uid, version] : uidVersions) {
e.detail(format("BackupID%d", i), uid).detail(format("Version%d", i), version);
e.detail(fmt::format("BackupID{}", i), uid).detail(fmt::format("Version{}", i), version);
i++;
if (shouldExit && version < self->endVersion.get()) {
shouldExit = false;
Expand Down Expand Up @@ -500,7 +501,7 @@ ACTOR static Future<Void> monitorBackupStartedKeyChanges(BackupData* self) {
TraceEvent e("BackupWorkerGotStartKey", self->myId);
int i = 1;
for (auto [uid, version] : uidVersions) {
e.detail(format("BackupID%d", i), uid).detail(format("Version%d", i), version);
e.detail(fmt::format("BackupID{}", i), uid).detail(fmt::format("Version{}", i), version);
i++;
}
}
Expand Down
3 changes: 2 additions & 1 deletion fdbserver/ClusterRecovery.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "flow/ProtocolVersion.h"
#include "flow/Trace.h"

#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

static std::set<int> const& normalClusterRecoveryErrors() {
Expand Down Expand Up @@ -637,7 +638,7 @@ ACTOR static Future<Optional<Version>> getMinBackupVersion(Reference<ClusterReco
TraceEvent e("GotBackupStartKey", self->dbgid);
int i = 1;
for (auto [uid, version] : uidVersions) {
e.detail(format("BackupID%d", i), uid).detail(format("Version%d", i), version);
e.detail(fmt::format("BackupID{}", i), uid).detail(fmt::format("Version{}", i), version);
i++;
minVersion = minVersion.present() ? std::min(version, minVersion.get()) : version;
}
Expand Down
67 changes: 33 additions & 34 deletions fdbserver/ConsistencyScan.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "flow/DeterministicRandom.h"
#include "flow/Trace.h"
#include "fdbserver/QuietDatabase.h"
#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

#define DEBUG_SCAN_PROGRESS false
Expand Down Expand Up @@ -280,7 +281,7 @@ ACTOR Future<int> consistencyCheckReadData(UID myId,
state GetKeyValuesReply current = rangeResult.get();
DisabledTraceEvent("ConsistencyCheck_GetKeyValuesStream", myId)
.detail("DataSize", current.data.size())
.detail(format("StorageServer%d", j).c_str(), (*storageServerInterfaces)[j].id());
.detail(fmt::format("StorageServer{}", j).c_str(), (*storageServerInterfaces)[j].id());
*totalReadAmount += current.data.expectedSize();
// If we haven't encountered a valid storage server yet, then mark this as the baseline
// to compare against
Expand All @@ -295,42 +296,40 @@ ACTOR Future<int> consistencyCheckReadData(UID myId,
// Be especially verbose if in simulation
if (g_network->isSimulated()) {
int invalidIndex = -1;
fmt::print("MISMATCH AT VERSION {0}\n", req.version);
printf("\n%sSERVER %d (%s); shard = %s - %s:\n",
"",
j,
(*storageServerInterfaces)[j].address().toString().c_str(),
printable(req.begin.getKey()).c_str(),
printable(req.end.getKey()).c_str());
fmt::println("MISMATCH AT VERSION {0}", req.version);
fmt::print("\n{}SERVER {} ({}); shard = {} - {}:\n",
"",
j,
(*storageServerInterfaces)[j].address().toString(),
printable(req.begin.getKey()),
printable(req.end.getKey()));
for (int k = 0; k < current.data.size(); k++) {
printf("%d. %s => %s\n",
k,
printable(current.data[k].key).c_str(),
printable(current.data[k].value).c_str());
fmt::println(
"{}. {} => {}", k, printable(current.data[k].key), printable(current.data[k].value));
if (invalidIndex < 0 &&
(k >= reference.data.size() || current.data[k].key != reference.data[k].key ||
current.data[k].value != reference.data[k].value))
invalidIndex = k;
}

printf("\n%sSERVER %d (%s); shard = %s - %s:\n",
"",
firstValidServer->get(),
(*storageServerInterfaces)[firstValidServer->get()].address().toString().c_str(),
printable(req.begin.getKey()).c_str(),
printable(req.end.getKey()).c_str());
fmt::print("\n{}SERVER {} ({}); shard = {} - {}:\n",
"",
firstValidServer->get(),
(*storageServerInterfaces)[firstValidServer->get()].address().toString(),
printable(req.begin.getKey()),
printable(req.end.getKey()));
for (int k = 0; k < reference.data.size(); k++) {
printf("%d. %s => %s\n",
k,
printable(reference.data[k].key).c_str(),
printable(reference.data[k].value).c_str());
fmt::println("{}. {} => {}",
k,
printable(reference.data[k].key),
printable(reference.data[k].value));
if (invalidIndex < 0 &&
(k >= current.data.size() || reference.data[k].key != current.data[k].key ||
reference.data[k].value != current.data[k].value))
invalidIndex = k;
}

printf("\nMISMATCH AT %d\n\n", invalidIndex);
fmt::print("\nMISMATCH AT {}\n\n", invalidIndex);
}

// Data for trace event
Expand Down Expand Up @@ -461,21 +460,21 @@ ACTOR Future<int> consistencyCheckReadData(UID myId,
TraceEvent(isExpectedTSSMismatch || isFailed || expectInjected ? SevWarn : SevError,
"ConsistencyCheck_DataInconsistent",
myId)
.detail(format("StorageServer%d", j).c_str(), (*storageServerInterfaces)[j].id())
.detail(format("StorageServer%d", firstValidServer->get()).c_str(),
.detail(fmt::format("StorageServer{}", j).c_str(), (*storageServerInterfaces)[j].id())
.detail(fmt::format("StorageServer{}", firstValidServer->get()).c_str(),
(*storageServerInterfaces)[firstValidServer->get()].id())
.detail("ShardBegin", req.begin.getKey())
.detail("ShardEnd", req.end.getKey())
.detail("VersionNumber", req.version)
.detail(format("Server%dUniques", j).c_str(), currentUniques)
.detail(format("Server%dUniqueKey", j).c_str(), currentUniqueKey)
.detail(format("Server%dUniques", firstValidServer->get()).c_str(), referenceUniques)
.detail(format("Server%dUniqueKey", firstValidServer->get()).c_str(), referenceUniqueKey)
.detail(fmt::format("Server{}Uniques", j).c_str(), currentUniques)
.detail(fmt::format("Server{}UniqueKey", j).c_str(), currentUniqueKey)
.detail(fmt::format("Server{}Uniques", firstValidServer->get()).c_str(), referenceUniques)
.detail(fmt::format("Server{}UniqueKey", firstValidServer->get()).c_str(), referenceUniqueKey)
.detail("ValueMismatches", valueMismatches)
.detail("ValueMismatchKey", valueMismatchKey)
.detail("MatchingKVPairs", matchingKVPairs)
.detail(format("Server%dHasMore", j).c_str(), current.more)
.detail(format("Server%dHasMore", firstValidServer->get()).c_str(), reference.more)
.detail(fmt::format("Server{}HasMore", j).c_str(), current.more)
.detail(fmt::format("Server{}HasMore", firstValidServer->get()).c_str(), reference.more)
.detail("IsTSS", isTss)
.detail("IsInjected", expectInjected);

Expand Down Expand Up @@ -2005,7 +2004,7 @@ ACTOR Future<Void> checkDataConsistency(Database cx,
.detail("NumSampledKeys", sampledKeys)
.detail("NumSampledKeysWithProb", sampledKeysWithProb);

testFailure(format("Shard size is more than %f std dev from estimate", failErrorNumStdDev),
testFailure(fmt::format("Shard size is more than {:f} std dev from estimate", failErrorNumStdDev),
performQuiescentChecks,
success,
failureIsError);
Expand Down Expand Up @@ -2048,8 +2047,8 @@ ACTOR Future<Void> checkDataConsistency(Database cx,
.detail("ShardEnd", printable(range.end))
.detail("ShardCount", ranges.size())
.detail("SampledKeys", sampledKeys);
testFailure(format("Shard size in quiescent database is too %s",
(sampledBytes < shardBounds.min.bytes) ? "small" : "large"),
testFailure(fmt::format("Shard size in quiescent database is too {}",
(sampledBytes < shardBounds.min.bytes) ? "small" : "large"),
performQuiescentChecks,
success,
failureIsError);
Expand Down
3 changes: 2 additions & 1 deletion fdbserver/Coordination.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "fdbclient/MonitorLeader.h"
#include "flow/network.h"

#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

// This module implements coordinationServer() and the interfaces in CoordinationInterface.h
Expand Down Expand Up @@ -797,7 +798,7 @@ ACTOR Future<Void> coordinationServer(std::string dataFolder, Reference<ICluster
state std::vector<Future<Reference<IAsyncFile>>> fs;
fs.reserve(2);
for (int i = 0; i < 2; ++i) {
std::string file = joinPath(dataFolder, format("%s%d.fdq", fileCoordinatorPrefix.c_str(), i));
std::string file = joinPath(dataFolder, fmt::format("{}{}.fdq", fileCoordinatorPrefix, i));
fs.push_back(
IAsyncFileSystem::filesystem()->open(file,
IAsyncFile::OPEN_READWRITE | IAsyncFile::OPEN_UNCACHED |
Expand Down
8 changes: 5 additions & 3 deletions fdbserver/DDRelocationQueue.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "fdbserver/DDTxnProcessor.h"
#include "flow/DebugTrace.h"
#include "fdbserver/DDRelocationQueue.h"
#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

#define WORK_FULL_UTILIZATION 10000 // This is not a knob; it is a fixed point scaling factor!
Expand Down Expand Up @@ -392,7 +393,7 @@ class ParallelTCInfo final : public ReferenceCounted<ParallelTCInfo>, public IDa
std::string id;
for (int i = 0; i < teams.size(); i++) {
auto const& team = teams[i];
id += (i == teams.size() - 1) ? team->getTeamID() : format("%s, ", team->getTeamID().c_str());
id += (i == teams.size() - 1) ? team->getTeamID() : fmt::format("{}, ", team->getTeamID());
}
return id;
}
Expand Down Expand Up @@ -421,8 +422,9 @@ std::string Busyness::toString() {
j++;
if (i != 1)
result += ", ";
result += i + 1 == j ? format("%03d", i * 100) : format("%03d/%03d", i * 100, (j - 1) * 100);
result += format("=%1.02f (%d/%d)", (float)ledger[i] / WORK_FULL_UTILIZATION, ledger[i], WORK_FULL_UTILIZATION);
result += i + 1 == j ? fmt::format("{:03}", i * 100) : fmt::format("{:03}/{:03}", i * 100, (j - 1) * 100);
result += fmt::format(
"={:1.02f} ({}/{})", (float)ledger[i] / WORK_FULL_UTILIZATION, ledger[i], WORK_FULL_UTILIZATION);
i = j;
}
return result;
Expand Down
23 changes: 12 additions & 11 deletions fdbserver/DDTeamCollection.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "flow/Trace.h"
#include "flow/network.h"

#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

namespace {
Expand Down Expand Up @@ -6271,11 +6272,11 @@ class DDTeamCollectionUnitTest {
int zone_id = process_id / 10;
int machine_id = process_id / 5;

printf("testMachineTeamCollection: process_id:%d zone_id:%d machine_id:%d ip_addr:%s\n",
process_id,
zone_id,
machine_id,
interface.address().toString().c_str());
fmt::println("testMachineTeamCollection: process_id:{} zone_id:{} machine_id:{} ip_addr:{}",
process_id,
zone_id,
machine_id,
interface.address().toString());
interface.locality.set("processid"_sr, Standalone<StringRef>(std::to_string(process_id)));
interface.locality.set("machineid"_sr, Standalone<StringRef>(std::to_string(machine_id)));
interface.locality.set("zoneid"_sr, Standalone<StringRef>(std::to_string(zone_id)));
Expand All @@ -6288,7 +6289,7 @@ class DDTeamCollectionUnitTest {
}

int totalServerIndex = collection->constructMachinesFromServers();
printf("testMachineTeamCollection: construct machines for %d servers\n", totalServerIndex);
fmt::println("testMachineTeamCollection: construct machines for {} servers", totalServerIndex);

return collection;
}
Expand Down Expand Up @@ -6325,7 +6326,7 @@ class DDTeamCollectionUnitTest {
state std::unique_ptr<DDTeamCollection> collection = testMachineTeamCollection(teamSize, policy, processSize);

if (collection == nullptr) {
fprintf(stderr, "collection is null\n");
fmt::println(stderr, "collection is null");
return Void();
}

Expand Down Expand Up @@ -6951,10 +6952,10 @@ class DDTeamCollectionUnitTest {

wait(collection->getTeam(bestReq));
const auto [bestTeam, found1] = bestReq.reply.getFuture().get();
fmt::print("{} {} {}\n",
SERVER_KNOBS->CPU_PIVOT_RATIO,
collection->teamPivots.pivotCPU,
collection->teamPivots.pivotAvailableSpaceRatio);
fmt::println("{} {} {}",
SERVER_KNOBS->CPU_PIVOT_RATIO,
collection->teamPivots.pivotCPU,
collection->teamPivots.pivotAvailableSpaceRatio);
ASSERT(bestTeam.present());
ASSERT_EQ(bestTeam.get()->getServerIDs(), std::vector<UID>{ UID(2, 0) });

Expand Down
7 changes: 3 additions & 4 deletions fdbserver/DDTxnProcessor.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "fdbserver/DataDistribution.actor.h"
#include "fdbclient/DatabaseContext.h"
#include "flow/genericactors.actor.h"
#include "fmt/format.h"
#include "flow/actorcompiler.h" // This must be the last #include.

static void updateServersAndCompleteSources(std::set<UID>& servers,
Expand Down Expand Up @@ -1071,10 +1072,8 @@ ACTOR Future<Void> rawStartMovement(std::shared_ptr<MockGlobalState> mgs,
}
// 2. merge ops will coalesce the boundary in finishMovement;
intersectRanges = mgs->shardMapping->intersectingRanges(keys);
fmt::print("Keys: {}; intersect: {} {}\n",
keys.toString(),
intersectRanges.begin().begin(),
intersectRanges.end().begin());
fmt::println(
"Keys: {}; intersect: {} {}", keys.toString(), intersectRanges.begin().begin(), intersectRanges.end().begin());
// NOTE: What if there is a split follow up by a merge?
// ASSERT(keys.begin == intersectRanges.begin().begin());
// ASSERT(keys.end == intersectRanges.end().begin());
Expand Down
Loading