-
Notifications
You must be signed in to change notification settings - Fork 581
Refactor LR Publication responses to use partial metadata #17960
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
Conversation
re-test this please |
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.
thank you! made a first pass and left some comments, but I will dive in more with a second pass.
server/src/test/java/io/crate/integrationtests/MetadataTrackerITest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/crate/replication/logical/action/PublicationsStateAction.java
Show resolved
Hide resolved
server/src/main/java/io/crate/replication/logical/metadata/Publication.java
Outdated
Show resolved
Hide resolved
public static AllocPosition forTable(RelationMetadata.Table table) { | ||
int maxPosition = 0; | ||
HashMap<ColumnIdent, Integer> colPositions = new HashMap<>(); | ||
for (Reference reference : table.columns()) { |
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.
If I remember right table.columns()
also contains deleted columns - might need to add a isDropped()
check here to account 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.
right, will do, thx!
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.
hm, but also positions of dropped columns should be resolvable. E.g. we added concrete logic here https://github.com/crate/crate/blob/master/server/src/main/java/io/crate/execution/ddl/tables/MappingUtil.java#L65 to also resolve positions of dropped columns.
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.
So I'd keep it like that or any objections @mfussenegger ?
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.
My main concern was that the put of a dropped column could override it's replacement, which would mean the lookup would get the old position. Not sure if that causes issues here but could use a putIfAbsent for dropped cols.
If it's not an issue, fine to keep as is.
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 see, I think you're right and this can be an issue. I've adapted the code to ensure dropped cols won't override existing entries by using a dedicated map.
52dd24f
to
a35d8fe
Compare
a35d8fe
to
59c0149
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.
thank you!
59c0149
to
0254f05
Compare
This pull request has been removed from the queue for the following reason: Pull request #17960 has been dequeued, merge conditions unmatch:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. |
Instead of responding concrete special entities for describing new or changed tables, the logical replication PublicationState action returns a partial Metadata containing all relevant information. This removes the handling of these special entities and also simplifies any future changes inside the table structures. The new partial Metadata will contain the new RelationMetadata entities, any deprecated template handling is removed. Requests from/to older nodes are handled transparently Relates to #17518, #17769.
b98a01c
to
208d742
Compare
This pull request has been removed from the queue for the following reason: Pull request #17960 has been dequeued, merge conditions unmatch:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. |
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
Instead of responding concrete special entities for describing new or changed tables, the logical replication PublicationState action returns a partial Metadata containing all relevant information. This removes the handling of these special entities and also simplifies any future changes inside the table structures.
The new partial Metadata will contain the new RelationMetadata entities, any deprecated template handling is removed. Requests from/to older nodes are handled transparently
Relates to #17518, #17769.