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

[BugFix] Fix loadAlterJob failed when upgrade from version smaller than 3.1.2 #38172

Merged
merged 3 commits into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,12 @@ public void loadHeaderV2(DataInputStream dis) throws IOException {

public long loadAlterJob(DataInputStream dis, long checksum) throws IOException {
long newChecksum = checksum;
for (AlterJobV2.JobType type : AlterJobV2.JobType.values()) {
// Notice: The order in types must be ROLLUP, SCHEMA_CHANGE, DECOMMISSION_BACKEND,
// if changed, the image read will fail.
List<AlterJobV2.JobType> types = Lists.newArrayList(AlterJobV2.JobType.ROLLUP,
Copy link
Contributor

@trueeyu trueeyu Dec 29, 2023

Choose a reason for hiding this comment

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

Why create a new list every time I execute it?

AlterJobV2.JobType.SCHEMA_CHANGE, AlterJobV2.JobType.DECOMMISSION_BACKEND);

for (AlterJobV2.JobType type : types) {
newChecksum = loadAlterJob(dis, newChecksum, type);
}
LOG.info("finished replay alterJob from image");
Expand Down
Loading