@@ -1414,13 +1414,6 @@ void RaftReplDev::handle_commit(repl_req_ptr_t rreq, bool recovery) {
14141414 m_listener->on_commit (rreq->lsn (), rreq->header (), rreq->key (), {rreq->local_blkid ()}, rreq);
14151415 }
14161416
1417- if (!recovery) {
1418- auto prev_lsn = m_commit_upto_lsn.exchange (rreq->lsn ());
1419- RD_DBG_ASSERT_GT (rreq->lsn (), prev_lsn,
1420- " Out of order commit of lsns, it is not expected in RaftReplDev. cur_lsns={}, prev_lsns={}" ,
1421- rreq->lsn (), prev_lsn);
1422- }
1423-
14241417 // Remove the request from repl_key map only after the listener operation is completed.
14251418 // This prevents unnecessary block allocation in the following scenario:
14261419 // 1. The follower processes a commit for LSN 100 and remove rreq from rep_key map before listener commit
@@ -1431,6 +1424,13 @@ void RaftReplDev::handle_commit(repl_req_ptr_t rreq, bool recovery) {
14311424 m_repl_key_req_map.erase (rreq->rkey ());
14321425 // Remove the request from lsn map.
14331426 m_state_machine->unlink_lsn_to_req (rreq->lsn (), rreq);
1427+
1428+ if (!recovery) {
1429+ auto prev_lsn = m_commit_upto_lsn.exchange (rreq->lsn ());
1430+ RD_DBG_ASSERT_GT (rreq->lsn (), prev_lsn,
1431+ " Out of order commit of lsns, it is not expected in RaftReplDev. cur_lsns={}, prev_lsns={}" ,
1432+ rreq->lsn (), prev_lsn);
1433+ }
14341434 if (!rreq->is_proposer ()) rreq->clear ();
14351435}
14361436
0 commit comments