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 incorrect schema id after upgrade (backport #44372) #44397

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
import java.util.stream.Collectors;

public class MaterializedIndexMeta implements Writable, GsonPostProcessable {
private static final long UNINITIALIZED_SCHEMA_ID = -1;

@SerializedName(value = "indexId")
private long indexId;
@SerializedName(value = "schema")
Expand Down Expand Up @@ -92,9 +90,7 @@ public class MaterializedIndexMeta implements Writable, GsonPostProcessable {
private Expr whereClause;
private Set<Long> updateSchemaBackendId;

// Default constructor will be invoked by the gson library
private MaterializedIndexMeta() {
schemaId = UNINITIALIZED_SCHEMA_ID;
public MaterializedIndexMeta() {
}

public MaterializedIndexMeta(long indexId, List<Column> schema, int schemaVersion, int schemaHash,
Expand Down Expand Up @@ -355,7 +351,7 @@ public static MaterializedIndexMeta read(DataInput in) throws IOException {

@Override
public void gsonPostProcess() throws IOException {
if (schemaId == UNINITIALIZED_SCHEMA_ID) {
if (schemaId <= 0) {
schemaId = indexId;
}
// analyze define stmt
Expand Down