void deactivate() {
        if (!active()) {
            throw new RuntimeException("Can't deactivate inactive OffsetControlManager.");
        }
        metrics.setActive(false);
        metrics.setLastAppliedRecordOffset(lastStableOffset);
        this.nextWriteOffset = -1L;
        if (!snapshotRegistry.hasSnapshot(lastStableOffset)) {
            throw new RuntimeException("Unable to reset to last stable offset " + lastStableOffset +
                    ". No in-memory snapshot found for this offset.");
        }
        snapshotRegistry.revertToSnapshot(lastStableOffset);
    }
Called when the QuorumController becomes inactive.
metadata/src/main/java/org/apache/kafka/controller/OffsetControlManager.java