The replay NPE bug has caused many cases that make all FE down. To avoid this from happening, It’s necessary to check null when get DB and Table object at any time. I suggest that returns Optional object when get DB and Table object to normalize the null check. DdlException and AnalysisException can be throwed by Optional.orElseThrow. Replay routine can log a warning when meet the unexpected absence of DB and Table to trace possible cases of metadata inconsistency.
=。=