This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 02fad48870a [Fix](upgrade) Fix fields not handled correctly during
upgrade and downgrade (#36691)
02fad48870a is described below
commit 02fad48870a0f0e7c861e6b4ad1bb929f51e659d
Author: abmdocrt <[email protected]>
AuthorDate: Sat Jun 22 14:23:04 2024 +0800
[Fix](upgrade) Fix fields not handled correctly during upgrade and
downgrade (#36691)
master version is #36690
---
be/src/exec/tablet_info.cpp | 10 ++++++++++
gensrc/proto/descriptors.proto | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/be/src/exec/tablet_info.cpp b/be/src/exec/tablet_info.cpp
index e32e9c9efcf..a8efbd338a3 100644
--- a/be/src/exec/tablet_info.cpp
+++ b/be/src/exec/tablet_info.cpp
@@ -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();
@@ -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;
}
diff --git a/gensrc/proto/descriptors.proto b/gensrc/proto/descriptors.proto
index 13c069f414f..21fc646c92d 100644
--- a/gensrc/proto/descriptors.proto
+++ b/gensrc/proto/descriptors.proto
@@ -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];
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]