Skip to content

PD store usage not right in master. #4906

@jiaqizho

Description

@jiaqizho

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  • The tiflash used from tiflash metrics

image

  • The metrics from pd

image

They both called getFsStats(). And but get the different result.
I think the problem in pd.rs handle_store_heartbeat:

let capacity = store_stats.fs_stats.capacity_size;
        let available = store_stats.fs_stats.avail_size;
        stats.set_used_size(store_stats.fs_stats.used_size);
        stats.set_capacity(capacity);

        let used_size = self.snap_mgr.get_total_snap_size().unwrap()
            + store_info
                .kv_engine
                .get_engine_used_size()
                .expect("kv engine used size")
            + store_info
                .raft_engine
                .get_engine_size()
                .expect("raft engine used size");
        stats.set_used_size(used_size);

The below set_used_size replace the origin one.

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions