| 1158 | } |
| 1159 | |
| 1160 | void 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 |
no test coverage detected