branch-2.1: [fix](external catalog) Fixed non-master FE log replay during refresh (#46373)

cherry-pick #46369
This commit is contained in:
zy-kkk
2025-01-03 22:03:30 +08:00
committed by GitHub
parent 69de40ca27
commit e9921d7a07
11 changed files with 72 additions and 21 deletions

View File

@ -718,7 +718,7 @@ public abstract class ExternalCatalog
public void replayInitCatalog(InitCatalogLog log) {
// If the remote name is missing during upgrade, all databases in the Map will be reinitialized.
if (log.getRemoteDbNames() == null || log.getRemoteDbNames().isEmpty()) {
if (log.getCreateCount() > 0 && (log.getRemoteDbNames() == null || log.getRemoteDbNames().isEmpty())) {
dbNameToId = Maps.newConcurrentMap();
idToDb = Maps.newConcurrentMap();
lastUpdateTime = log.getLastUpdateTime();

View File

@ -191,7 +191,7 @@ public abstract class ExternalDatabase<T extends ExternalTable>
public void replayInitDb(InitDatabaseLog log, ExternalCatalog catalog) {
// If the remote name is missing during upgrade, all tables in the Map will be reinitialized.
if (log.getRemoteTableNames() == null || log.getRemoteTableNames().isEmpty()) {
if (log.getCreateCount() > 0 && (log.getRemoteTableNames() == null || log.getRemoteTableNames().isEmpty())) {
tableNameToId = Maps.newConcurrentMap();
idToTbl = Maps.newConcurrentMap();
lastUpdateTime = log.getLastUpdateTime();