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

Avoid txn conflicts between write and compact on the same inode #5308

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

polyrabbit
Copy link
Contributor

We observed many txn conflicts between write and compact when using TiKV, especially when users have many small IOs. TiKV's txn conflicts are very expensive, we can avoid them on the client side by using inode-granularity locks.
One downside of this change is that compaction between chunks within an inode cannot be performed concurrently, but considering chunks are 64M, so the probability of small IOs spanning multiple chunks is relatively low.

method: doCompactChunk, error: write conflict { start_ts:453879141784617034 conflict_ts:453879141784617033 primary:"xia\375A\013\000\003\000\000\000\000\000C\000\000\000\000" reason:Optimistic

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

Successfully merging this pull request may close these issues.

1 participant