code: private boolean checkIngestState() throws IOException {
      if (currentIngestState == StandbyIngestState.INGESTING_EDITS) {
        String msg = "";
        if (ingest == null) {
          msg = "Standby: Ingest instantiation failed, the state is "
              + currentIngestState + ", but the ingest is null";
        }
        if (currentSegmentTxId != ingest.getStartTxId()) {
          msg = "Standby: Ingest instantiation failed, trying to instantiate ingest for txid: "
              + currentSegmentTxId
              + ", but there is ingest for txid: "
              + ingest.getStartTxId();
        }
        if (currentIngestState == StandbyIngestState.NOT_INGESTING
            && ingest.isRunning()) {
          msg = "Standby: Ingest instantiation failed, the state is "
              + currentIngestState + " but the ingest is running";
        }
        if (!msg.isEmpty()) {
          LOG.warn(msg);
          throw new IOException(msg);
        }
        return true;
      }
      return false;
    }
docs: Check the correct ingest state for instantiating new ingest
  (synchronized on ingestStateLock)
  @return true if the ingest for the requested txid is running
  @throws IOException when the state is incorrect