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 (apache#26597) (apache#26756)
  • Loading branch information
JackDrogon authored and gnehil committed Dec 4, 2023
1 parent aaab47a commit 0324f9e
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 @@ -531,6 +531,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 @@ -1764,6 +1764,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 0324f9e

Please sign in to comment.