Skip to content

Commit

Permalink
Merge branch 'main' of github.com:apple/foundationdb into fix-nightly…
Browse files Browse the repository at this point in the history
…-failure
  • Loading branch information
sfc-gh-clin committed Jan 26, 2023
2 parents 4c5cbe6 + bbba0e1 commit 285cb46
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
8 changes: 5 additions & 3 deletions bindings/go/src/fdb/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,11 @@ func (o DatabaseOptions) SetUseConfigDatabase() error {
return o.setOpt(800, nil)
}

// An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery.
func (o DatabaseOptions) SetTestCausalReadRisky() error {
return o.setOpt(900, nil)
// Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so.
//
// Parameter: integer between 0 and 100 expressing the probability a client will verify it can't read stale data
func (o DatabaseOptions) SetTestCausalReadRisky(param int64) error {
return o.setOpt(900, int64ToBytes(param))
}

// The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault
Expand Down
3 changes: 2 additions & 1 deletion fdbclient/vexillographer/fdb.options
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ description is not currently required but encouraged.
<Option name="use_config_database" code="800"
description="Use configuration database." />
<Option name="test_causal_read_risky" code="900"
description="An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery." />
paramType="Int" paramDescription="integer between 0 and 100 expressing the probability a client will verify it can't read stale data"
description="Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so." />
</Scope>

<Scope name="TransactionOption">
Expand Down
10 changes: 9 additions & 1 deletion fdbserver/BlobManager.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ struct BlobWorkerInfo {
BlobWorkerInfo(int numGranulesAssigned = 0) : numGranulesAssigned(numGranulesAssigned) {}
};

enum BoundaryEvalType { UNKNOWN, MERGE, SPLIT };
// recover is when the BM assigns an ambiguously owned range on recovery
// merge is when the BM initiated a merge candidate for the range
// split is when the BM initiated a split check for the range
enum BoundaryEvalType { UNKNOWN, RECOVER, MERGE, SPLIT };

struct BoundaryEvaluation {
int64_t epoch;
Expand Down Expand Up @@ -3835,6 +3838,11 @@ ACTOR Future<Void> recoverBlobManager(Reference<BlobManagerData> bmData) {
// if worker id is already set to a known worker that replied with it in the mapping, range is already assigned
// there. If not, need to explicitly assign it to someone
if (workerId == UID() || epoch == 0 || !endingWorkers.count(workerId)) {
// prevent racing status updates from old owner from causing issues until this request gets sent out
// properly
bmData->boundaryEvaluations.insert(
range.range(), BoundaryEvaluation(bmData->epoch, 0, BoundaryEvalType::RECOVER, bmData->epoch, 0));

RangeAssignment raAssign;
raAssign.isAssign = true;
raAssign.worker = workerId;
Expand Down
8 changes: 6 additions & 2 deletions fdbserver/storageserver.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6124,7 +6124,8 @@ void applyMutation(StorageServer* self,
void applyChangeFeedMutation(StorageServer* self,
MutationRef const& m,
MutationRefAndCipherKeys const& encryptedMutation,
Version version) {
Version version,
KeyRangeRef const& shard) {
if (m.type == MutationRef::SetValue) {
for (auto& it : self->keyChangeFeed[m.param1]) {
if (version < it->stopVersion && !it->removing && version > it->emptyVersion) {
Expand Down Expand Up @@ -6184,6 +6185,9 @@ void applyChangeFeedMutation(StorageServer* self,
clearMutation.param2 = it->range.end;
modified = true;
}
if (!modified && (clearMutation.param1 == shard.begin || clearMutation.param2 == shard.end)) {
modified = true;
}
if (it->mutations.empty() || it->mutations.back().version != version) {
it->mutations.push_back(
EncryptedMutationsAndVersionRef(version, self->knownCommittedVersion.get()));
Expand Down Expand Up @@ -8520,7 +8524,7 @@ void StorageServer::addMutation(Version version,
}

applyChangeFeedMutation(
this, expanded.type == MutationRef::ClearRange ? nonExpanded : expanded, encrypt, version);
this, expanded.type == MutationRef::ClearRange ? nonExpanded : expanded, encrypt, version, shard);
}
applyMutation(this, expanded, mLog.arena(), mutableData(), version);

Expand Down

0 comments on commit 285cb46

Please sign in to comment.