-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
No elide constructors #7798
No elide constructors #7798
Conversation
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.
Otherwise, 👍 👍 👍
Makefile
Outdated
@@ -190,6 +190,8 @@ else | |||
endif | |||
|
|||
ifdef ASSERT_STATUS_CHECKED | |||
# For ASC, turn off constructor elision |
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 "what" comment doesn't tell me anything I can't reverse engineer from about 3 seconds of reading the Makefile. Tell me why.
I can't even turn it off and see what breaks, because it only works to prevent regressions.
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.
@pdillinger has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
And four clang-analyze false positive "pointer is NULL" reports to suppress. I don't think we have a better way than what is shown in 99f5a80 (though a comment for why assert(db != nullptr)
is preferred, such as // suppress false clang-analyze report
).
@mrambacher has updated the pull request. You must reimport the pull request before landing. |
db/corruption_test.cc
Outdated
@@ -616,7 +616,7 @@ TEST_F(CorruptionTest, ParanoidFileChecksOnFlush) { | |||
options.table_factory = mock; | |||
mock->SetCorruptionMode(mode); | |||
ASSERT_OK(DB::Open(options, dbname_, &db_)); | |||
assert(db_ != nullptr); |
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.
These asserts were put there for clang analyzer (without an informative comment 😢 ) and changing them leads to return of the false reports.
@mrambacher has updated the pull request. You must reimport the pull request before landing. |
037bace
to
db6033f
Compare
@mrambacher has updated the pull request. You must reimport the pull request before landing. |
@mrambacher has updated the pull request. You must reimport the pull request before landing. |
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.
Awesomeness. Thanks!
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.
@pdillinger has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@pdillinger merged this pull request in 55e9968. |
@@ -627,7 +627,7 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( | |||
if (sfm) { | |||
std::string file_path = MakeTableFileName( | |||
cfds[i]->ioptions()->cf_paths[0].path, file_meta[i].fd.GetNumber()); | |||
sfm->OnAddFile(file_path); | |||
s = sfm->OnAddFile(file_path); |
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.
Stress test now sometimes shows a problem and I suspect that this line is related. Here is the failure:
2020/12/26-14:41:51.516292 14b0efeeb700 [ERROR] [/db_impl/db_impl_compaction_flush.cc:2521] Waiting after background flush error: IO error: No such file or directorywhile stat a file for size: /dev/shm/rocksdb/rocksdb_c
rashtest_whitebox/000000.sst: No such file or directoryAccumulated background error counts: 1
My theory is that, in the case where the memtable is empty, there is no file flushed but here the registration is called anyway. It used to be that sfm->OnAddFile() rejected it since the file doesn't exist, but now it fails the flush, which is unexpected. If we agree that it is the problem, we should fix 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.
@siying There is a comparable line above (line 287). The errors could be ignored if required or is there a way to test that the file is not empty/was flushed? How do we write a test to show this failure?
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.
If atomic flush is enabled, SFM is enabled, and there are more than one CF with all of their memtables to be empty, a Flush() call might trigger this issue.
A better fix might be that if no file is generated, we should not go into this code path. We probably can know whether a file is created (file_meta[i] is ever updated) in some way.
…lideConstructors
Push a change to revert the checks on SFM for stress test failures. |
@mrambacher has updated the pull request. You must reimport the pull request before landing. |
6b32313
to
b8c5322
Compare
@mrambacher has updated the pull request. You must reimport the pull request before landing. |
// TODO (PR7798). We should only add the file to the FileManager if it | ||
// exists. Otherwise, some tests may fail. Ignore the error in the | ||
// interim. | ||
sfm->OnAddFile(file_path).PermitUncheckedError(); |
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 for the fix. It looks good but I think we should create a new PR to fix it, rather than changing an existing one.
Split the ignore for the SSTFileManager::OnAddFile into #7826 |
Summary: Added "no-elide-constructors to the ASSERT_STATUS_CHECK builds. This flag gives more errors/warnings for some of the Status checks where an inner class checks a Status and later returns it. In this case, without the elide check on, the returned status may not have been checked in the caller, thereby bypassing the checked code. Pull Request resolved: facebook#7798 Reviewed By: jay-zhuang Differential Revision: D25680451 Pulled By: pdillinger fbshipit-source-id: c3f14ed9e2a13f0a8c54d839d5fb4d1fc1e93917
Summary: Added "no-elide-constructors to the ASSERT_STATUS_CHECK builds. This flag gives more errors/warnings for some of the Status checks where an inner class checks a Status and later returns it. In this case, without the elide check on, the returned status may not have been checked in the caller, thereby bypassing the checked code. Pull Request resolved: facebook/rocksdb#7798 Reviewed By: jay-zhuang Differential Revision: D25680451 Pulled By: pdillinger fbshipit-source-id: c3f14ed9e2a13f0a8c54d839d5fb4d1fc1e93917 Signed-off-by: Changlong Chen <levisonchen@live.cn>
Summary: Added "no-elide-constructors to the ASSERT_STATUS_CHECK builds. This flag gives more errors/warnings for some of the Status checks where an inner class checks a Status and later returns it. In this case, without the elide check on, the returned status may not have been checked in the caller, thereby bypassing the checked code. Pull Request resolved: facebook/rocksdb#7798 Reviewed By: jay-zhuang Differential Revision: D25680451 Pulled By: pdillinger fbshipit-source-id: c3f14ed9e2a13f0a8c54d839d5fb4d1fc1e93917 Signed-off-by: Changlong Chen <levisonchen@live.cn>
Added "no-elide-constructors to the ASSERT_STATUS_CHECK builds. This flag gives more errors/warnings for some of the Status checks where an inner class checks a Status and later returns it. In this case, without the elide check on, the returned status may not have been checked in the caller, thereby bypassing the checked code.