Skip to content

Commit

Permalink
[Fix](upgrade) Fix fields not handled correctly during upgrade and do…
Browse files Browse the repository at this point in the history
…wngrade (#36691)

master version is #36690
  • Loading branch information
Yukang-Lian authored Jun 22, 2024
1 parent 17cf34b commit 02fad48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions be/src/exec/tablet_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ Status OlapTableSchemaParam::init(const POlapTableSchemaParam& pschema) {
_is_strict_mode = pschema.is_strict_mode();
if (_is_partial_update) {
_auto_increment_column = pschema.auto_increment_column();
if (!_auto_increment_column.empty() && pschema.auto_increment_column_unique_id() == -1) {
return Status::InternalError(
"Auto increment column id is not set in FE. Maybe FE is an older version "
"different from BE.");
}
_auto_increment_column_unique_id = pschema.auto_increment_column_unique_id();
}
_timestamp_ms = pschema.timestamp_ms();
Expand Down Expand Up @@ -187,6 +192,11 @@ Status OlapTableSchemaParam::init(const TOlapTableSchemaParam& tschema) {
}
if (_is_partial_update) {
_auto_increment_column = tschema.auto_increment_column;
if (!_auto_increment_column.empty() && tschema.auto_increment_column_unique_id == -1) {
return Status::InternalError(
"Auto increment column id is not set in FE. Maybe FE is an older version "
"different from BE.");
}
_auto_increment_column_unique_id = tschema.auto_increment_column_unique_id;
}

Expand Down
2 changes: 1 addition & 1 deletion gensrc/proto/descriptors.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ message POlapTableSchemaParam {
optional string auto_increment_column = 10;
optional int64 timestamp_ms = 11 [default = 0];
optional string timezone = 12;
optional int32 auto_increment_column_unique_id = 13;
optional int32 auto_increment_column_unique_id = 13 [default = -1];
};

0 comments on commit 02fad48

Please sign in to comment.