-
Notifications
You must be signed in to change notification settings - Fork 568
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
Send partition values instead of index name in OpenTableRequest #17079
Conversation
a3e01b1
to
4672b52
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 otherwise
import io.crate.metadata.RelationName; | ||
|
||
|
||
public class OpenTableRequest extends AcknowledgedRequest<OpenTableRequest> { |
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 feels a bit strange that now a OpenTableRequest
is also used on the CloseTableAction
. Worth adding an empty CloseTableRequest
extending on this? Or we call it just TableRequest
?
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.
Where is it used? I don't see it in TransportCloseTable
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'll go ahead with this because I'll need to make the same change for the CloseTableRequest
anyway. But please comment so I can then adapt it as part of the other PR.
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.
Ah my fault, I saw it at the CloseTableClusterStateExecutor
, but this is now unused, so all fine.
See #17081, I've removed unused class and merge the abstract one.
String partitionIndexName = in.readOptionalString(); | ||
partitionValues = PartitionName.fromIndexOrTemplate(partitionIndexName).values(); |
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.
We can have NPE here, PartitionName.fromIndexOrTemplate
doesn't work with null values whereas partitionIndexName
can be null.
I think we need a test for that
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.
Good catch. Added a fixup
Helps #16964 To support table swap or rename without having to close and open shards it's necessary that a index has no relation name association. That means index names will be replaced by UUIDs and to identify partitions we need to keep holding onto relationName + partition values or the index uuid.
509de45
to
94f20a5
Compare
Merge the abstract class in it's afterwards only implementation. Follow up of #17079
Merge the abstract class in it's afterwards only implementation. Follow up of #17079
Same as #17079 but for close
Same as #17079 but for close
Helps #16964
To support table swap or rename without having to close and open shards
it's necessary that a index has no relation name association.
That means index names will be replaced by UUIDs and to identify
partitions we need to keep holding onto relationName + partition values
or the index uuid.