Skip to content

Commit

Permalink
[hotfix](editlog) Fix upsert replay on follower not contains loadedTa…
Browse files Browse the repository at this point in the history
…bleIndexIds (#26597)

Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
  • Loading branch information
JackDrogon authored Nov 9, 2023
1 parent 124a8a9 commit db31784
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ public static void loadJournal(Env env, Long logId, JournalEntity journal) {
Env.getCurrentGlobalTransactionMgr().replayUpsertTransactionState(state);
LOG.debug("logid: {}, opcode: {}, tid: {}", logId, opCode, state.getTransactionId());

// state.loadedTableIndexIds is updated after replay
if (state.getTransactionStatus() == TransactionStatus.VISIBLE) {
UpsertRecord upsertRecord = new UpsertRecord(logId, state);
Env.getCurrentEnv().getBinlogManager().addUpsertRecord(upsertRecord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,7 @@ private boolean updateCatalogAfterVisible(TransactionState transactionState, Dat
tableId, transactionState.getTransactionId(), db.getId());
continue;
}
transactionState.addTableIndexes(table);
for (PartitionCommitInfo partitionCommitInfo : tableCommitInfo.getIdToPartitionCommitInfo().values()) {
long partitionId = partitionCommitInfo.getPartitionId();
long newCommitVersion = partitionCommitInfo.getVersion();
Expand Down

0 comments on commit db31784

Please sign in to comment.