Skip to content

Commit

Permalink
[Enhancement] Checkpoint outputs misleading logs when loading materia…
Browse files Browse the repository at this point in the history
…lized views. (#51002)

Signed-off-by: edwinhzhang <[email protected]>
  • Loading branch information
zhangheihei authored Sep 18, 2024
1 parent c55f765 commit 8a34503
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4937,6 +4937,11 @@ public void save(ImageWriter imageWriter) throws IOException, SRMetaBlockExcepti
writer.close();
}

/**
* When loading the LocalMetastore, the DB/Catalog that the materialized view depends
* on may not have been loaded yet, so you cannot reload the materialized view.
* The reload operation of a materialized view should be called by {@link GlobalStateMgr#postLoadImage()}.
*/
public void load(SRMetaBlockReader reader) throws IOException, SRMetaBlockException, SRMetaBlockEOFException {
int dbSize = reader.readInt();
for (int i = 0; i < dbSize; ++i) {
Expand All @@ -4950,7 +4955,7 @@ public void load(SRMetaBlockReader reader) throws IOException, SRMetaBlockExcept
idToDb.put(db.getId(), db);
fullNameToDb.put(db.getFullName(), db);
stateMgr.getGlobalTransactionMgr().addDatabaseTransactionMgr(db.getId());
db.getTables().forEach(tbl -> {
db.getTables().stream().filter(tbl -> !tbl.isMaterializedView()).forEach(tbl -> {
try {
tbl.onReload();
if (tbl.isTemporaryTable()) {
Expand Down

0 comments on commit 8a34503

Please sign in to comment.