gavinchou commented on code in PR #37293:
URL: https://github.com/apache/doris/pull/37293#discussion_r1699312896
##########
cloud/src/meta-service/meta_service_job.cpp:
##########
@@ -49,6 +49,29 @@ namespace doris::cloud {
static constexpr int COMPACTION_DELETE_BITMAP_LOCK_ID = -1;
static constexpr int SCHEMA_CHANGE_DELETE_BITMAP_LOCK_ID = -2;
+// check compaction input_versions are valid during schema change.
+// If the schema change job doesnt have alter version, it dont need to check
+// because the schema change job is come from old version BE.
+// we will check they in prepare compaction and commit compaction.
+// 1. When if base compaction, we need to guarantee the end version
+// is less than or equal to alter_version.
+// 2. When if cu compaction, we need to guarantee the start version
+// is large than alter_version.
+bool check_compaction_input_verions(const TabletCompactionJobPB& compaction,
+ const TabletJobInfoPB& job_pb) {
+ if (!job_pb.has_schema_change() ||
!job_pb.schema_change().has_alter_version()) return true;
+ // compaction need to know [start_version, end_version]
+ DCHECK_EQ(compaction.input_versions_size(), 2) <<
proto_to_json(compaction);
Review Comment:
if () logging
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]