[hotfix](editlog) Fix upsert replay on follower not contains loadedTableIndexIds (#26597)

Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
This commit is contained in:
Jack Drogon
2023-11-09 12:21:43 +08:00
committed by GitHub
parent 124a8a9b34
commit db317841a0
2 changed files with 2 additions and 0 deletions

View File

@ -530,6 +530,7 @@ public class EditLog {
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);

View File

@ -1769,6 +1769,7 @@ public class DatabaseTransactionMgr {
tableId, transactionState.getTransactionId(), db.getId());
continue;
}
transactionState.addTableIndexes(table);
for (PartitionCommitInfo partitionCommitInfo : tableCommitInfo.getIdToPartitionCommitInfo().values()) {
long partitionId = partitionCommitInfo.getPartitionId();
long newCommitVersion = partitionCommitInfo.getVersion();