docs: private void changeState() {
          if (m_state == State.RESTORE) {
              fetchSnapshotTxnId();
  
              exitRestore();
              m_state = State.REPLAY;
  
              /*
               * Add the interest here so that we can use the barriers in replay
               * agent to synchronize.
               */
              m_snapshotMonitor.addInterest(this);
              m_replayAgent.replay();
          } else if (m_state == State.REPLAY) {
              m_state = State.TRUNCATE;
          } else if (m_state == State.TRUNCATE) {
              m_snapshotMonitor.removeInterest(this);
              if (m_callback != null) {
                  m_callback.onReplayCompletion(m_truncationSnapshot, m_truncationSnapshotPerPartition);
              }
  
              // Call balance partitions after enabling transactions on the node to shorten the recovery time
              if (m_isLeader) {
                  m_replayAgent.resumeElasticOperationIfNecessary();
              }
          }
      }