-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keys,roachpb: change default system tenant from tenantID {1} to {2} #133926
base: master
Are you sure you want to change the base?
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
sqlEncoder: sqlEncoder{&MinKey, &MaxKey, roachpb.SystemTenantID}, | ||
// | ||
// TODO(chandrat) revisit minKey and maxKeys. | ||
var PrefixlessSystemSQLCodec = SQLCodec{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be more accurate if we named this:
var PrefixlessSystemSQLCodec = SQLCodec{ | |
var PrefixlessSQLCodec = SQLCodec{ |
pkg/roachpb/tenant.go
Outdated
return id == SystemTenantID.ToUint64() | ||
return id == TenantTwo.ToUint64() || id == TenantOne.ToUint64() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this new logic should only take place if we have the env var set?
By default tenantID {1} is used as system tenant which is prefixless. `COCKROACH_EXPERIMENTAL_UA` environment variable is used to change the default system tenant from tenantID {1} to {2}.
b1fe111
to
0c0ef7c
Compare
Co-authored-by: Chandra Thumuluru <[email protected]>
When we start the `TenantTwo` we want it to have `system` as its name from the very beginning. To achieve this, instead of rewriting keys we use KVWriter. `TenantTwo`'s name would become `system`, and `TenantOne`'s name would be whatever is passed to `create_tenant` command (ideally, `main`). Note, we are chaning this value for `TenantTwo`'s `tenants` table, not for the `TenantOne`'s system table.
By default tenantID {1} is used as system tenant which is prefixless.
COCKROACH_EXPERIMENTAL_UA
environment variable is used to change the default system tenant from tenantID {1} to {2}.