-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
OnFlushCompleted is called before flush completed #5892
Comments
@siying @riversand963 Is this expected behavior? Thanks. |
Thanks @yiwu-arbug for reporting. Probably not expected behavior. The assumption used to be one flush job per column family. Since atomic flush, it has changed such that multiple flush jobs can work on different (but consecutive) memtables of the same column family. |
@riversand963 thanks for taking a look. It seems that the behavior is not introduced by the recent atomic flush feature, but exists since when |
@riversand963 I'm working on a fix. Should I call |
@yiwu-arbug I looked at API comments and original implementation. It seems that the contract is: |
…ebook#5908) (#127) Summary: When there are concurrent flush job on the same CF, `OnFlushCompleted` can be called before the flush result being install to LSM. Fixing the issue by passing `FlushJobInfo` through `MemTable`, and the thread who commit the flush result can fetch the `FlushJobInfo` and fire `OnFlushCompleted` on behave of the thread actually writing the SST. Fix facebook#5892 Pull Request resolved: facebook#5908 Test Plan: Add new test. The test will fail without the fix. Differential Revision: D17916144 Pulled By: riversand963 fbshipit-source-id: e18df67d9533b5baee52ae3605026cdeb05cbe10
…ebook#5908) Summary: When there are concurrent flush job on the same CF, `OnFlushCompleted` can be called before the flush result being install to LSM. Fixing the issue by passing `FlushJobInfo` through `MemTable`, and the thread who commit the flush result can fetch the `FlushJobInfo` and fire `OnFlushCompleted` on behave of the thread actually writing the SST. Fix facebook#5892 Pull Request resolved: facebook#5908 Test Plan: Add new test. The test will fail without the fix. Differential Revision: D17916144 Pulled By: riversand963 fbshipit-source-id: e18df67d9533b5baee52ae3605026cdeb05cbe10
…ebook#5908) (#127) (#130) Summary: When there are concurrent flush job on the same CF, `OnFlushCompleted` can be called before the flush result being install to LSM. Fixing the issue by passing `FlushJobInfo` through `MemTable`, and the thread who commit the flush result can fetch the `FlushJobInfo` and fire `OnFlushCompleted` on behave of the thread actually writing the SST. Fix facebook#5892 Pull Request resolved: facebook#5908 Test Plan: Add new test. The test will fail without the fix. Differential Revision: D17916144 Pulled By: riversand963 fbshipit-source-id: e18df67d9533b5baee52ae3605026cdeb05cbe10 Signed-off-by: Yi Wu <[email protected]>
Expected behavior
When
OnFlushCompleted
is called, we assume the corresponding memtable has finished flush - the data has been persisted as SST file, and the LSM has been updated with the result.Actual behavior
When there are concurrent flush job on the same CF,
OnFlushCompleted
can be called before the flush result being install to LSM. For example:TryInstallMemtableFlushResults
failed because A has not finish.OnFlushCompleted
before the flush finish.Just want to confirm if this is expected behavior. If so, how about we expose
WaitForFlushMemTable
API to allow user to wait for the flush afterOnFlushCompleted
? If not expect, any suggestion on how to fix it?Steps to reproduce the behavior
Reproduced with the demo test: https://github.com/yiwu-arbug/rocksdb/commit/3d56d68de6e3e6c61f2fe80aff1f7195476ac6d9
The text was updated successfully, but these errors were encountered: