MCPcopy Create free account
hub / github.com/apple/foundationdb / writeMutation

Function writeMutation

fdbserver/CommitProxyServer.actor.cpp:1160–1174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1158}
1159
1160void writeMutation(CommitBatchContext* self, int64_t tenantId, const MutationRef& mutation) {
1161 static_assert(TenantInfo::INVALID_TENANT == ENCRYPT_INVALID_DOMAIN_ID);
1162 if (!self->pProxyCommitData->isEncryptionEnabled || tenantId == TenantInfo::INVALID_TENANT) {
1163 // TODO(yiwu): In raw access mode, use tenant prefix to figure out tenant id for user data
1164 bool isRawAccess = tenantId == TenantInfo::INVALID_TENANT && !isSystemKey(mutation.param1) &&
1165 !(mutation.type == MutationRef::ClearRange && isSystemKey(mutation.param2)) &&
1166 self->pProxyCommitData->db->get().client.tenantMode == TenantMode::REQUIRED;
1167 CODE_PROBE(isRawAccess, "Raw access to tenant key space");
1168 self->toCommit.writeTypedMessage(mutation);
1169 } else {
1170 Arena arena;
1171 self->toCommit.writeTypedMessage(
1172 EncryptedMutationMessage::encrypt(arena, self->cipherKeys, tenantId /*domainId*/, mutation));
1173 }
1174}
1175
1176/// This second pass through committed transactions assigns the actual mutations to the appropriate storage servers'
1177/// tags

Calls 4

isSystemKeyFunction · 0.85
encryptFunction · 0.85
writeTypedMessageMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected