-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#20852] docdb: Add mtime and checksum to block cache key prefix
Summary: Problem: In RocksDB, the file id used for block cache key prefix is generated using file inode information (inode device ID, inode number, and inode generation). However, file systems like XFS and ext4 reuse inodes(inode number, and inode generation), which means the block cache key for new files may point to stale entries from deleted files. Fix: The mtime and the checksum of the meta-block are added to the prefix key. The mtime (4 bytes) is finalized once the data is flushed and remains unchanged even if a hard link is created. The checksum (4 bytes) is calculated based on the meta-block content of the SST file. With the combination of inode, mtime and checksum, a conflict will be extremely unlikely. Jira: DB-9839 Test Plan: 1. existing rocksdb unit test. 2. Added a new unit test: ybd tsan --cxx-test table_test --gtest_filter TableTest.BlockCacheWithHardlink --clang17 Reviewers: timur, arybochkin, rthallam Reviewed By: timur Subscribers: ybase Differential Revision: https://phorge.dev.yugabyte.com/D39729
- Loading branch information
Showing
9 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters