This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 84de478994b [feat](binlog) add modify distribution type binlog (#50077)
84de478994b is described below
commit 84de478994bc5a190c6c8651e73ce56040615cbf
Author: koarz <[email protected]>
AuthorDate: Thu Apr 24 15:32:54 2025 +0800
[feat](binlog) add modify distribution type binlog (#50077)
https://github.com/selectdb/ccr-syncer/pull/596
---
.../src/main/java/org/apache/doris/binlog/BinlogManager.java | 11 +++++++++++
.../src/main/java/org/apache/doris/persist/EditLog.java | 5 ++++-
gensrc/thrift/FrontendService.thrift | 6 +++---
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/binlog/BinlogManager.java
b/fe/fe-core/src/main/java/org/apache/doris/binlog/BinlogManager.java
index f1c25f57c85..0d17efdb6de 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/binlog/BinlogManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/binlog/BinlogManager.java
@@ -470,6 +470,17 @@ public class BinlogManager {
addBinlog(dbId, tableIds, commitSeq, timestamp, type, data, false,
info);
}
+ public void addModifyDistributionType(TableInfo info, long commitSeq) {
+ long dbId = info.getDbId();
+ List<Long> tableIds = Lists.newArrayList();
+ tableIds.add(info.getTableId());
+ long timestamp = System.currentTimeMillis();
+ TBinlogType type = TBinlogType.MODIFY_DISTRIBUTION_TYPE;
+ String data = info.toJson();
+
+ addBinlog(dbId, tableIds, commitSeq, timestamp, type, data, false,
info);
+ }
+
public void
addModifyTableAddOrDropInvertedIndices(TableAddOrDropInvertedIndicesInfo info,
long commitSeq) {
long dbId = info.getDbId();
List<Long> tableIds = Lists.newArrayList();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java
b/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java
index d45c3f47917..824caf78bd1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java
@@ -849,6 +849,7 @@ public class EditLog {
case OperationType.OP_MODIFY_DISTRIBUTION_TYPE: {
TableInfo tableInfo = (TableInfo) journal.getData();
env.replayConvertDistributionType(tableInfo);
+
env.getBinlogManager().addModifyDistributionType(tableInfo, logId);
break;
}
case OperationType.OP_DYNAMIC_PARTITION:
@@ -1937,7 +1938,9 @@ public class EditLog {
}
public void logModifyDistributionType(TableInfo tableInfo) {
- logEdit(OperationType.OP_MODIFY_DISTRIBUTION_TYPE, tableInfo);
+ long logId = logEdit(OperationType.OP_MODIFY_DISTRIBUTION_TYPE,
tableInfo);
+ LOG.info("add modify distribution type binlog, logId: {}, infos: {}",
logId, tableInfo);
+
Env.getCurrentEnv().getBinlogManager().addModifyDistributionType(tableInfo,
logId);
}
public void logModifyCloudWarmUpJob(CloudWarmUpJob cloudWarmUpJob) {
diff --git a/gensrc/thrift/FrontendService.thrift
b/gensrc/thrift/FrontendService.thrift
index 5fea9abf470..9e6cddba329 100644
--- a/gensrc/thrift/FrontendService.thrift
+++ b/gensrc/thrift/FrontendService.thrift
@@ -1028,7 +1028,8 @@ enum TBinlogType {
RENAME_PARTITION = 22,
DROP_ROLLUP = 23,
RECOVER_INFO = 24,
- MODIFY_DISTRIBUTION_BUCKET_NUM = 25
+ MODIFY_DISTRIBUTION_BUCKET_NUM = 25,
+ MODIFY_DISTRIBUTION_TYPE = 26,
// Keep some IDs for allocation so that when new binlog types are added in
the
// future, the changes can be picked back to the old versions without
breaking
@@ -1045,8 +1046,7 @@ enum TBinlogType {
// MODIFY_XXX = 17,
// MIN_UNKNOWN = 18,
// UNKNOWN_3 = 19,
- MIN_UNKNOWN = 26,
- UNKNOWN_11 = 27,
+ MIN_UNKNOWN = 27,
UNKNOWN_12 = 28,
UNKNOWN_13 = 29,
UNKNOWN_14 = 30,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]