-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
the invisible mvcc versions are not purged by gc #12729
Comments
@shaoxiqian thanks for your report! In the current implementation, MVCC-deletions can only be handled at the bottlemost level. #10545 may be helpful for this case, we will continue on it. |
/severity critical |
I think this is a critical bug for the default gc. It’s devastating that the old mvcc versions are not purged from the user perspective. |
/severity major |
/remove-severity critical |
/remove-severity critical |
@shaoxiqian: These labels are not set on the issue: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/cc jiayang-zheng |
I think an easy fix is to change the function tikv/components/raftstore/src/store/worker/compact.rs Lines 177 to 192 in dcb5e2c
If there are too many versions, compaction should be triggered for write cf, otherwise stale versions won't be deleted. |
Maybe it's needed to consider more about the compaction triggering strategy, before that we could abstract a simpler case to help investigate this issue. |
/assign jiayang-zheng |
@tonyxuqqi: GitHub didn't allow me to assign the following users: jiayang-zheng. Note that only tikv members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@tonyxuqqi |
ref tikv#12729 work-in-progress: do not merge, needs unit tests. adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ```
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ```
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ```
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic.
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 adds the concept of a full compaction: a compaction that compacts all columns families, ranges, and levels. this has the effect of deleting all of the tombstone markers. if ``raftstore.full-compact-tick-interval`` is set, attempt running full compaction at least frequently. if ``raftstore.full_compact_restrict_hours_local_tz`` is set, run full compaction only during the hours specified. the tikv.yaml segment below will run compaction at 03:00 and 23:00 (3am and 11pm respectively) in the tikv nodes' local timezone. ``` [raftstore] full-compact-tick-interval = "1h" full-compact-restrict-hours-local-tz = [3, 23] ``` to address in in follow up PRs: * integration tests. * pausing/rate-limiting full compactions to avoid disrupting live traffic. Signed-off-by: Alex Feinberg <alex@strlen.net>
ref tikv#12729 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ref tikv#12729 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ref tikv#12729 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
another PR to address this is merged: #15995 |
Since we already have the enhanced check_compact as well as the periodic full compaction. I think the issue can be closed for now. |
Bug Report
What version of TiKV are you using?
v5.4.0
What operating system and CPU are you using?
Steps to reproduce
This is a customer's workload which is only "read"
What did you expect?
TiKV will clear the invisible mvcc version automatically when there are a lot of rocksdb tombstone keys instead of waiting for compaction file GC
What did happened?
QPS is just 49.9
IO usage on TiKV is high, avg 571MB/s. CPU usage of TiDB/TiKV is low.
We can see the total_keys is almost equal to key_skipped_count. It means during the scan, coprocessor meets a lot of versions.
The iterator calls millions of next but only process tens of keys. It means there are too many invisible mvcc versions in the TiKV. From the flamegraph, the iterator is busy spinning on finding next valid key.
From TiKV metrics, that GC rarely happens in the collected time frame.
There is no modifications during the time frame, so no gc is executed
All above shows there are too many delete versions that have not been compacted into tombstones which affected the performance.
The text was updated successfully, but these errors were encountered: