mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-03 03:41:53 +08:00
Disallow setting raw access on a transaction that has specified a tenant
This commit is contained in:
parent
445754d7cb
commit
149ca44b9b
@ -6359,10 +6359,12 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optional<Strin
|
||||
// System key access implies raw access. Native API handles the raw access,
|
||||
// system key access is handled in RYW.
|
||||
validateOptionValueNotPresent(value);
|
||||
if (trState->tenant.present()) {
|
||||
Error e = invalid_option();
|
||||
TraceEvent(SevWarn, "TenantTransactionRawAccess").error(e).detail("Tenant", trState->tenant);
|
||||
throw e;
|
||||
}
|
||||
trState->options.rawAccess = true;
|
||||
trState->tenant = Optional<TenantName>();
|
||||
trState->tenantId = TenantInfo::INVALID_TENANT;
|
||||
tr.tenantInfo = TenantInfo();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user