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

[#3190] fix(jdbc-backend): Fix the cast issue when Relational Garbage Collector cleaning fileset version info #3191

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

xloya
Copy link
Contributor

@xloya xloya commented Apr 26, 2024

What changes were proposed in this pull request?

When obtaining the maximum version result of fileset, pass the result into the object to solve the ClassCastException problem.

Why are the changes needed?

Fix: #3190

How was this patch tested?

Add some ITs.

@xloya xloya closed this Apr 26, 2024
@xloya xloya reopened this Apr 26, 2024
@jerryshao jerryshao changed the title [#3190] fix(jdbc-backend): Fix the cast issue when Relatinal Garbage Collector cleaning fileset version info [#3190] fix(jdbc-backend): Fix the cast issue when Relational Garbage Collector cleaning fileset version info Apr 29, 2024
@yuqi1129 yuqi1129 added need backport Issues that need to backport to another branch branch-0.5 labels Apr 29, 2024

public class FilesetMaxVersionPO {
private Long filesetId;
private Long version;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we change the data type of version from integer to Long?

Copy link
Contributor Author

@xloya xloya Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuqi1129 I don't think it's necessary, generally integer unsigned is enough, and now when we deserialize to Java, we use Long encapsulation by default. The problem here is that the return value type of the max() function after processing version is different in different databases. In MySQL, here the Long type is returned; And in H2, the Integer type is returned. It is enough for us to do this here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuqi1129 yuqi1129 merged commit cccb3eb into apache:main Apr 30, 2024
34 of 47 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 30, 2024
… Collector cleaning fileset version info (#3191)

### What changes were proposed in this pull request?

When obtaining the maximum version result of fileset, pass the result
into the object to solve the `ClassCastException` problem.

### Why are the changes needed?

Fix: #3190 

### How was this patch tested?

Add some ITs.

---------

Co-authored-by: xiaojiebao <[email protected]>
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Jun 13, 2024
…arbage Collector cleaning fileset version info (apache#3191)

### What changes were proposed in this pull request?

When obtaining the maximum version result of fileset, pass the result
into the object to solve the `ClassCastException` problem.

### Why are the changes needed?

Fix: apache#3190 

### How was this patch tested?

Add some ITs.

---------

Co-authored-by: xiaojiebao <[email protected]>
@xloya xloya deleted the issue-3190 branch June 20, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need backport Issues that need to backport to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] Relational Garbage Collector throw a ClassCastException when cleaning fileset version info
2 participants