This is an automated email from the ASF dual-hosted git repository.
lide 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 bada731390 [fix](restore) fix bug when replay restore and reserve
dynamic partition (#17326)
bada731390 is described below
commit bada7313907a7e17a52ca7297f482717e43bb4c5
Author: xueweizhang <[email protected]>
AuthorDate: Tue Mar 7 10:13:08 2023 +0800
[fix](restore) fix bug when replay restore and reserve dynamic partition
(#17326)
when replay restore a table with reserve_dynamic_partition_enable=true,
must registerOrRemoveDynamicPartitionTable with isReplay=true, or maybe
cause
OBSERVER can not replay restore auditlog success.
---
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
index 6f3a77ba66..1fd3de6352 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
@@ -1464,7 +1464,7 @@ public class RestoreJob extends AbstractJob {
// set all restored partition version and version hash
// set all tables' state to NORMAL
- setTableStateToNormal(db, true);
+ setTableStateToNormal(db, true, isReplay);
for (long tblId : restoredVersionInfo.rowKeySet()) {
Table tbl = db.getTableNullable(tblId);
if (tbl == null) {
@@ -1632,7 +1632,7 @@ public class RestoreJob extends AbstractJob {
Database db = env.getInternalCatalog().getDbNullable(dbId);
if (db != null) {
// rollback table's state to NORMAL
- setTableStateToNormal(db, false);
+ setTableStateToNormal(db, false, isReplay);
// remove restored tbls
for (Table restoreTbl : restoredTbls) {
@@ -1709,7 +1709,7 @@ public class RestoreJob extends AbstractJob {
LOG.info("finished to cancel restore job. is replay: {}. {}",
isReplay, this);
}
- private void setTableStateToNormal(Database db, boolean committed) {
+ private void setTableStateToNormal(Database db, boolean committed, boolean
isReplay) {
for (String tableName : jobInfo.backupOlapTableObjects.keySet()) {
Table tbl =
db.getTableNullable(jobInfo.getAliasByOriginNameIfSet(tableName));
if (tbl == null) {
@@ -1743,7 +1743,7 @@ public class RestoreJob extends AbstractJob {
}
if (committed && reserveDynamicPartitionEnable) {
if (DynamicPartitionUtil.isDynamicPartitionTable(tbl)) {
-
DynamicPartitionUtil.registerOrRemoveDynamicPartitionTable(db.getId(), olapTbl,
false);
+
DynamicPartitionUtil.registerOrRemoveDynamicPartitionTable(db.getId(), olapTbl,
isReplay);
Env.getCurrentEnv().getDynamicPartitionScheduler().createOrUpdateRuntimeInfo(tbl.getId(),
DynamicPartitionScheduler.LAST_UPDATE_TIME,
TimeUtils.getCurrentFormatTime());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]