Repository: tikv/tikv
File: components/raftstore/src/store/fsm/store.rs (Rust)

Code before:
                .swap(0, Ordering::Relaxed),
        );

        let busy_on_apply = self.check_store_is_busy_on_apply(
            start_time,
            stats.get_region_count() as u64,
            busy_apply_peers_count,
            completed_apply_peers_count,
        );

        if !busy_on_apply {
            // If the store already passes the check, it should clear the
            // `completed_apply_peers_count` to skip the check next time.
            if completed_apply_peers_count.is_some() {
                let mut meta = self.ctx.store_meta.lock().unwrap();
                meta.completed_apply_peers_count = None;
                meta.busy_apply_peers.clear();
            }

            if GLOBAL_SERVER_READINESS
                .raft_peers_caught_up
                .compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
                .is_ok()
            {
                // Log when the server readiness condition changes.
                info!("ServerReadiness: Raft peers have caught up applying logs");
            }
        }

        let store_is_busy = self
            .ctx
            .global_stat
            .stat
            .is_busy
            .swap(false, Ordering::Relaxed);
        stats.set_is_busy(store_is_busy || busy_on_apply);
        STORE_PROCESS_BUSY_GAUGE_VEC
            .applystore_busy
            .set(busy_on_apply as i64);
        STORE_PROCESS_BUSY_GAUGE_VEC
            .raftstore_busy
            .set(store_is_busy as i64);

        let mut query_stats = QueryStats::default();
        query_stats.set_put(
            self.ctx
                .global_stat
                .stat
                .engine_total_query_put
                .swap(0, Ordering::Relaxed),
        );

Review comment (suggestion):
How about:
```suggestion
                info!("ServerReadiness: Raft pending peers have caught up applying logs");
```

Code after:
            self.ctx
                .global_stat
                .stat
                .engine_total_keys_written
                .swap(0, Ordering::Relaxed),
        );

        let busy_on_apply = self.check_store_is_busy_on_apply(
            start_time,
            stats.get_region_count() as u64,
            busy_apply_peers_count,
            completed_apply_peers_count,
        );

        if !busy_on_apply {
            // If the store already passes the check, it should clear the
            // `completed_apply_peers_count` to skip the check next time.
            if completed_apply_peers_count.is_some() {
                let mut meta = self.ctx.store_meta.lock().unwrap();
                meta.completed_apply_peers_count = None;
                meta.busy_apply_peers.clear();
            }

            if GLOBAL_SERVER_READINESS
                .raft_peers_caught_up
                .compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
                .is_ok()
            {
                // Log when the server readiness condition changes.
                info!("ServerReadiness: Raft pending peers have caught up applying logs");
            }
        }

        let store_is_busy = self
            .ctx
            .global_stat
            .stat
            .is_busy
            .swap(false, Ordering::Relaxed);
        stats.set_is_busy(store_is_busy || busy_on_apply);
        STORE_PROCESS_BUSY_GAUGE_VEC
            .applystore_busy
            .set(busy_on_apply as i64);
        STORE_PROCESS_BUSY_GAUGE_VEC
            .raftstore_busy
            .set(store_is_busy as i64);

        let mut query_stats = QueryStats::default();
        query_stats.set_put(
            self.ctx
                .global_stat