[fix](meta) remove default_cluster prefix in recover db log (#30350)
This commit is contained in:
@ -216,7 +216,8 @@ public class Database extends MetaObject implements Writable, DatabaseIf<Table>
|
||||
public void setNameWithLock(String newName) {
|
||||
writeLock();
|
||||
try {
|
||||
this.fullQualifiedName = newName;
|
||||
// ClusterNamespace.getNameFromFullName should be removed in 3.0
|
||||
this.fullQualifiedName = ClusterNamespace.getNameFromFullName(newName);
|
||||
for (Table table : idToTable.values()) {
|
||||
table.setQualifiedDbName(fullQualifiedName);
|
||||
}
|
||||
|
||||
@ -649,7 +649,7 @@ public class InternalCatalog implements CatalogIf<Database> {
|
||||
String tableName = recoverStmt.getTableName();
|
||||
String newTableName = recoverStmt.getNewTableName();
|
||||
|
||||
Database db = (Database) getDbOrDdlException(dbName);
|
||||
Database db = getDbOrDdlException(dbName);
|
||||
db.writeLockOrDdlException();
|
||||
try {
|
||||
if (Strings.isNullOrEmpty(newTableName)) {
|
||||
@ -698,10 +698,6 @@ public class InternalCatalog implements CatalogIf<Database> {
|
||||
}
|
||||
}
|
||||
|
||||
public void replayEraseDatabase(long dbId) throws DdlException {
|
||||
Env.getCurrentRecycleBin().replayEraseDatabase(dbId);
|
||||
}
|
||||
|
||||
public void replayRecoverDatabase(RecoverInfo info) {
|
||||
long dbId = info.getDbId();
|
||||
String newDbName = info.getNewDbName();
|
||||
|
||||
@ -18,9 +18,11 @@
|
||||
package org.apache.doris.persist;
|
||||
|
||||
import org.apache.doris.catalog.Env;
|
||||
import org.apache.doris.cluster.ClusterNamespace;
|
||||
import org.apache.doris.common.FeMetaVersion;
|
||||
import org.apache.doris.common.io.Text;
|
||||
import org.apache.doris.common.io.Writable;
|
||||
import org.apache.doris.persist.gson.GsonPostProcessable;
|
||||
import org.apache.doris.persist.gson.GsonUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@ -29,7 +31,7 @@ import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
|
||||
public class RecoverInfo implements Writable {
|
||||
public class RecoverInfo implements Writable, GsonPostProcessable {
|
||||
@SerializedName(value = "dbId")
|
||||
private long dbId;
|
||||
@SerializedName(value = "newDbName")
|
||||
@ -102,4 +104,9 @@ public class RecoverInfo implements Writable {
|
||||
tableId = in.readLong();
|
||||
partitionId = in.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gsonPostProcess() throws IOException {
|
||||
newDbName = ClusterNamespace.getNameFromFullName(newDbName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user