-
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
Only SyncClosedLogs
for multiple CFs
#4460
Conversation
ce7741c
to
c279aa5
Compare
@miasantreble PTAL. |
Nice. Also cc @ajkr |
I took a pass, and found that you removed the case of single column family, which should fail according to the test result of #4416 . Can you add a test for single column family case, too? |
Are you saying test |
Yes. Original implementation always calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @solicomo for this PR. I've left a comment.
Agreed. I'm working on it. |
8ab5782
to
94781ae
Compare
Hi @riversand963 , the unit test is added. Could you please review it again? |
Hi @solicomo , thanks for working on this. I noticed that you added a column family 'pikachu' in |
I think From the To make sure Similar thing to the tests in I hope I understand the code right. Please let me know if I am wrong. |
@solicomo Due to the sync points dependency in |
Are you saying, even |
Sorry for the confusion. |
OK, got it. |
4f0ca8d
to
5e95605
Compare
SyncClosedLogs
for multiple CFsSyncClosedLogs
for multiple CFs
5e95605
to
a0c88a0
Compare
Status Update: I am still working on it. It's almost there. I'm sorry for the delay. But don't blame me, blame Zelda and Nintendo. |
6255f44
to
8979c08
Compare
I rebased and squashed my commits and reworded the commit message. @riversand963 Could you take a look again? The reason of test failure @siying Could you please take a look, too? Because it is related to Thanks. |
fname = dir_to_sync + "/" + to_delete; | ||
fname = dir_to_sync | ||
+ (dir_to_sync.back() == '/' || to_delete.front() == '/' ? "" : "/") | ||
+ to_delete; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert dir_to_sync and to_delete are not empty.
Actually, maybe dir_to_sync can be empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my last comment. If you address this, I'll defer to @riversand963 to accept and merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new commit is pushed.
Actually, I think maybe we need something like canonicalize_file_name()
or realpath()
.
Thanks for your review.
Summary: Call `SyncClosedLogs()` only if there are more than one column families. See facebook#3840 for more info. The fix is pretty simple. We only need to change 0 to 1. But the hard part of this PR is fixing the test failures uncovered by this fix. - The first test failure came up is `DBFlushTest.SyncFail`. It is the easiest one. This test is trying to test the behavior of `SyncClosedLogs` when the file system is inactive. So it expects `SyncClosedLogs` can be called. To make sure `SyncClosedLogs` can be called, we have to create/open RocksDB with at least 2 column families. Extra '/' is to blame for all the following test failures. - The next test failure is `FaultInjectionTestSplitted.FaultTest`. After several steps, this test will try to delete all the files which is not fully synced. `FaultInjectionTestEnv` is used in this test case. `FaultInjectionTestEnv` is tracking all the files opened and deleted. Unfortunately, when a file is opened, `FaultInjectionTestEnv` is told that the file name is like `testrocksdb-26040/fault_test_2273688893793634580/000003.log`, but when that file is deleted, `FaultInjectionTestEnv` is told that the file name is like `testrocksdb-26040/fault_test_2273688893793634580//000003.log`. See the extra '/'? This extra '/' is added to the file name [on line 459 in `db_impl_files.cc`](https://github.com/facebook/rocksdb/blob/v5.15.10/db/db_impl_files.cc#L459). But why this test case passed before? Maybe it passed "by mistake". - `DBWALTestWithEnrichedEnv.SkipDeletedWALs` is the last test failure. After I fixed the extra '/' issue, I got this test failure. This test case was added in this commit: facebook@d595492 This commit tries to skip deleted WALs during recovery. If I am right, it works only when `allow_2pc` is enabled. But in this test case, `allow_2pc` is not enabled at all. Again, why this test case passed before? I think it is the extra '/' who should be blamed.
8979c08
to
efbd9a3
Compare
Good job! @solicomo, thanks for the improvement you make. Let me import your change for our internal build/check. Once that's done, we can merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
SyncClosedLogs
for multiple CFsSyncClosedLogs
for multiple CFs
) Summary: Call `SyncClosedLogs()` only if there are more than one column families. Update several unit tests (in `fault_injection_test` and `db_flush_test`) correspondingly. See facebook#3840 for more info. Pull Request resolved: facebook#4460 Differential Revision: D12896377 Pulled By: riversand963 fbshipit-source-id: f49afdaec32568f12f001219a3aec1dfde3b32bf
) Summary: Call `SyncClosedLogs()` only if there are more than one column families. Update several unit tests (in `fault_injection_test` and `db_flush_test`) correspondingly. See facebook#3840 for more info. Pull Request resolved: facebook#4460 Differential Revision: D12896377 Pulled By: riversand963 fbshipit-source-id: f49afdaec32568f12f001219a3aec1dfde3b32bf
Call
SyncClosedLogs()
only if there are more than one column families.Update several unit tests (in
fault_injection_test
anddb_flush_test
) correspondingly.See #3840 for more info.