Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlmostFull is not accurate #6415

Open
CalvinNeo opened this issue Dec 5, 2022 · 4 comments
Open

AlmostFull is not accurate #6415

CalvinNeo opened this issue Dec 5, 2022 · 4 comments

Comments

@CalvinNeo
Copy link
Member

CalvinNeo commented Dec 5, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

In init_storage_stats_task, we should use TiFlash's config.

...
        self.background_worker
            .spawn_interval_task(DEFAULT_STORAGE_STATS_INTERVAL, move || {
                let disk_stats = match fs2::statvfs(&store_path) {
                    Err(e) => {
                        error!(
                            "get disk stat for kv store failed";
                            "kv path" => store_path.to_str(),
                            "err" => ?e
                        );
                        return;
                    }
                    Ok(stats) => stats,
                };
...

1. Minimal reproduce step (Required)

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

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

@CalvinNeo
Copy link
Member Author

CalvinNeo commented Dec 5, 2022

IMO, the check is to protect local disk rather than the whole storage. Since TiFlash uses multi disk storages, a low-space-ratio of 0.8 is too strict, so we can simply raise low-space-ratio to solve this.

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Dec 5, 2022

After some testing, low-space-ratio only affects the region schedule (like add-peer) on PD.

While the threshold for almost full, DISK_RESERVED_SPACE, is calculated from min(raftstore.capacity, disk.total_space) * 0.05. If the disk available space is less than DISK_RESERVED_SPACE, we will see that proxy won't write blocks into tiflash storage layer.

@JaySon-Huang
Copy link
Contributor

Setting capacity in TiFlash is usually done by setting storage.main.capacity list, without setting the tiflash-proxy raftstore.capacity. It would be better we can override the tiflash-proxy raftstore.capacity config item by the first elem of storage.latest.capacity (which is proxy data stored in and the capacity is inferred by storage.main.capacity)

@CalvinNeo
Copy link
Member Author

There are 3 ways to do this:

  1. Disable this service
  2. Use a observer to retrieve disk capacity from TiFlash
  3. Use a command argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants