-
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
kv: stop sending InitPut, replace with CPut #88519
base: master
Are you sure you want to change the base?
kv: stop sending InitPut, replace with CPut #88519
Conversation
faa1492
to
394c2aa
Compare
First half of cockroachdb#71074. This commit replaces all client-side use of InitPut request with the equivalent use of CPut. It uses the following equivalence to perform this mapping: ``` InitPut(key, value) -> CPutAllowingIfNotExists(key, value, value) ``` A future change in v23.2 (or do we now allow skipping one major version?) can remove the server-side handling of InitPut and remove the proto message entirely, once we no longer need to ensure mixed-version compatibility with v22.2. This is primarily a clean-up that reduces the KV API surface area. However, it's also a useful simplification for cockroachdb#72614. Release justification: None. Release note: None.
394c2aa
to
f7f014d
Compare
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.
LGTM, thanks! Will defer to the others on caller migrations.
Is this abandoned? |
It's stale, but I'm happy to rebase it. Just needed a reviewer for the caller changes. |
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.
LGTM! from schema
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.
LGTM, just a few questions.
@@ -69,7 +70,11 @@ func CreateSystemTableInTxn( | |||
b.CPut(tKey, desc.GetID(), nil) | |||
b.CPut(catalogkeys.MakeDescMetadataKey(codec, desc.GetID()), desc.DescriptorProto(), nil) | |||
if desc.IsSequence() { | |||
b.InitPut(codec.SequenceKey(uint32(desc.GetID())), desc.GetSequenceOpts().Start, false /* failOnTombstones */) | |||
// TODO DURING REVIEW: @ajwerner, why was this an InitPut instead of a |
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.
Does anyone on @cockroachdb/sql-schema have ideas about this?
// NOTE: InitPutRequest is now deprecated and should no longer be used. See | ||
// #71074. The request type still exists for compatibility with v22.2 and | ||
// earlier releases. The server-side handling code can be deleted once | ||
// compatibility with v22.2 is no longer needed. |
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.
nit: I think the "v22.2" references here should now be "v23.1".
@@ -222,24 +222,24 @@ query T kvtrace | |||
INSERT INTO t VALUES (5, 4, 'bar') | |||
---- | |||
CPut /Table/112/1/5/0 -> /TUPLE/2:2:Int/4/1:3:Bytes/bar | |||
InitPut /Table/112/2/4/5/0 -> /BYTES/ |
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.
It's not obvious to me why these were InitPut
s in the first place - these secondary index keys should not already exist. Was there a performance benefit to only using CPut
for the primary index to catch conflicts? Does the same benefit still exist for CPut
vs CPutAllowingIfNotExists
? If so, should we differentiate between the two types of CPut
s int traces like this? And if there is no benefit toCPut
over CPutAllowingIfNotExists
, should we convert these secondary index puts into CPut
s?
This PR was superseded by #138707. |
First half of #71074.
This commit replaces all client-side use of InitPut request with the equivalent use of CPut. It uses the following equivalence to perform this mapping:
A future change in v23.2 (or do we now allow skipping one major version?) can remove the server-side handling of InitPut and remove the proto message entirely, once we no longer need to ensure mixed-version compatibility with v22.2.
This is primarily a clean-up that reduces the KV API surface area. However, it's also a useful simplification for #72614.
Release justification: None.
Release note: None.