This is an automated email from the ASF dual-hosted git repository. w41ter 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 f2689ccba14 [feat](binlog) Support rename rollup & partition binlogs #44526 (#44662) f2689ccba14 is described below commit f2689ccba141a0f100ab384f5b8addcae5967bdc Author: walter <maoch...@selectdb.com> AuthorDate: Thu Nov 28 10:12:17 2024 +0800 [feat](binlog) Support rename rollup & partition binlogs #44526 (#44662) cherry pick from #44526 --- .../java/org/apache/doris/binlog/BinlogManager.java | 18 ++++++++++++++++++ .../main/java/org/apache/doris/persist/EditLog.java | 12 ++++++++---- gensrc/thrift/FrontendService.thrift | 6 +++--- 3 files changed, 29 insertions(+), 7 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 51cb6db33c6..8886c4b4104 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 @@ -336,6 +336,24 @@ public class BinlogManager { addBarrierLog(log, commitSeq); } + public void addRollupRename(TableInfo info, long commitSeq) { + long dbId = info.getDbId(); + long tableId = info.getTableId(); + TBinlogType type = TBinlogType.RENAME_ROLLUP; + String data = info.toJson(); + BarrierLog log = new BarrierLog(dbId, tableId, type, data); + addBarrierLog(log, commitSeq); + } + + public void addPartitionRename(TableInfo info, long commitSeq) { + long dbId = info.getDbId(); + long tableId = info.getTableId(); + TBinlogType type = TBinlogType.RENAME_PARTITION; + String data = info.toJson(); + BarrierLog log = new BarrierLog(dbId, tableId, type, data); + addBarrierLog(log, commitSeq); + } + public void addColumnRename(TableRenameColumnInfo info, long commitSeq) { long dbId = info.getDbId(); long tableId = info.getTableId(); 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 d4bea4c3dc7..261331ac863 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 @@ -314,7 +314,7 @@ public class EditLog { case OperationType.OP_RENAME_PARTITION: { TableInfo info = (TableInfo) journal.getData(); env.replayRenamePartition(info); - env.getBinlogManager().addTableRename(info, logId); + env.getBinlogManager().addPartitionRename(info, logId); break; } case OperationType.OP_RENAME_COLUMN: { @@ -362,7 +362,7 @@ public class EditLog { case OperationType.OP_RENAME_ROLLUP: { TableInfo info = (TableInfo) journal.getData(); env.replayRenameRollup(info); - env.getBinlogManager().addTableRename(info, logId); + env.getBinlogManager().addRollupRename(info, logId); break; } case OperationType.OP_LOAD_START: @@ -1544,11 +1544,15 @@ public class EditLog { } public void logRollupRename(TableInfo tableInfo) { - logEdit(OperationType.OP_RENAME_ROLLUP, tableInfo); + long logId = logEdit(OperationType.OP_RENAME_ROLLUP, tableInfo); + LOG.info("log rollup rename, logId : {}, infos: {}", logId, tableInfo); + Env.getCurrentEnv().getBinlogManager().addRollupRename(tableInfo, logId); } public void logPartitionRename(TableInfo tableInfo) { - logEdit(OperationType.OP_RENAME_PARTITION, tableInfo); + long logId = logEdit(OperationType.OP_RENAME_PARTITION, tableInfo); + LOG.info("log partition rename, logId : {}, infos: {}", logId, tableInfo); + Env.getCurrentEnv().getBinlogManager().addPartitionRename(tableInfo, logId); } public void logColumnRename(TableRenameColumnInfo info) { diff --git a/gensrc/thrift/FrontendService.thrift b/gensrc/thrift/FrontendService.thrift index aab338d009c..95f41158e94 100644 --- a/gensrc/thrift/FrontendService.thrift +++ b/gensrc/thrift/FrontendService.thrift @@ -1144,6 +1144,8 @@ enum TBinlogType { REPLACE_TABLE = 18, MODIFY_TABLE_ADD_OR_DROP_INVERTED_INDICES = 19, INDEX_CHANGE_JOB = 20, + RENAME_ROLLUP = 21, + RENAME_PARTITION = 22, // 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 @@ -1160,9 +1162,7 @@ enum TBinlogType { // MODIFY_XXX = 17, // MIN_UNKNOWN = 18, // UNKNOWN_3 = 19, - MIN_UNKNOWN = 21, - UNKNOWN_6 = 22, - UNKNOWN_7 = 23, + MIN_UNKNOWN = 23, UNKNOWN_8 = 24, UNKNOWN_9 = 25, UNKNOWN_10 = 26, --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org