[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
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

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

mfussenegger
Copy link
Member

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.

Copy link
Member
@seut seut left a 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> {
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Member

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.

Comment on lines 65 to 66
String partitionIndexName = in.readOptionalString();
partitionValues = PartitionName.fromIndexOrTemplate(partitionIndexName).values();
Copy link
Contributor

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

Copy link
Member Author

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.
@mfussenegger mfussenegger added the ready-to-merge Let Mergify merge the PR once approved and checks pass label Nov 27, 2024
@mergify mergify bot merged commit d8b83a0 into master Nov 27, 2024
14 checks passed
@mergify mergify bot deleted the j/open-table-request branch November 27, 2024 15:52
seut added a commit that referenced this pull request Nov 27, 2024
Merge the abstract class in it's afterwards only implementation.

Follow up of #17079
mergify bot pushed a commit that referenced this pull request Nov 27, 2024
Merge the abstract class in it's afterwards only implementation.

Follow up of #17079
mfussenegger added a commit that referenced this pull request Dec 2, 2024
mergify bot pushed a commit that referenced this pull request Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Let Mergify merge the PR once approved and checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants