Skip to content
Open
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
10 changes: 6 additions & 4 deletions fdbserver/MoveKeys.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3070,7 +3070,7 @@ ACTOR Future<Void> removeKeysFromFailedServer(Database cx,
}
}

const UID shardId = newDataMoveId(deterministicRandom()->randomUInt64(),
state UID shardId = newDataMoveId(deterministicRandom()->randomUInt64(),
AssignEmptyRange::True,
DataMoveType::LOGICAL,
DataMovementReason::ASSIGN_EMPTY_RANGE);
Expand All @@ -3089,20 +3089,22 @@ ACTOR Future<Void> removeKeysFromFailedServer(Database cx,
actors.push_back(
krmSetRangeCoalescing(&tr, serverKeysPrefixFor(id), range, allKeys, serverKeysFalse));
}
wait(waitForAll(actors));

// Assign the shard to the new team as an empty range.
// Note, there could be data loss.
std::vector<Future<Void>> emptyRangeActors;
for (const UID& id : teamForDroppedRange) {
if (SERVER_KNOBS->SHARD_ENCODE_LOCATION_METADATA) {
actors.push_back(krmSetRangeCoalescing(
emptyRangeActors.push_back(krmSetRangeCoalescing(
&tr, serverKeysPrefixFor(id), range, allKeys, serverKeysValue(shardId)));
} else {
actors.push_back(krmSetRangeCoalescing(
emptyRangeActors.push_back(krmSetRangeCoalescing(
&tr, serverKeysPrefixFor(id), range, allKeys, serverKeysTrueEmptyRange));
}
}

wait(waitForAll(actors));
wait(waitForAll(emptyRangeActors));

TraceEvent trace(SevWarnAlways, "ShardLossAllReplicasDropShard", serverID);
trace.detail("Begin", it.key);
Expand Down