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

Add missing status check when compiling with ASSERT_STATUS_CHECKED=1 #11686

Closed
wants to merge 2 commits into from

Conversation

cbi42
Copy link
Member

@cbi42 cbi42 commented Aug 8, 2023

It seems the flag -fno-elide-constructors is incorrectly overwritten in Makefile by

include make_config.mk

Applying the change in PR #11675 shows a lot of missing status checks. This PR adds the missing status checks.

Most of changes are just adding asserts in unit tests. I'll add pr comment around more interesting changes that need review.

Test plan: change Makefile as in #11675, and run ASSERT_STATUS_CHECKED=1 TEST_UINT128_COMPAT=1 ROCKSDB_MODIFY_NPHASH=1 LIB_MODE=static OPT="-DROCKSDB_NAMESPACE=alternative_rocksdb_ns" make V=1 -j24 J=24 check

db/db_impl/db_impl_secondary.cc Show resolved Hide resolved
db/version_set_test.cc Show resolved Hide resolved
@@ -34,6 +34,8 @@ namespace ROCKSDB_NAMESPACE {
#if defined OS_LINUX || defined OS_WIN
#ifndef __clang__
#ifndef ROCKSDB_UBSAN_RUN
// status check adds CXX flag -fno-elide-constructors which fails this test.
#ifndef ROCKSDB_ASSERT_STATUS_CHECKED
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests in this file fail when ROCKSDB_ASSERT_STATUS_CHECKED is enabled, so I disabled these tests for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, I'm only seeing one test failure. Are you seeing more failures for disabling the whole test?

[ RUN      ] OptionsSettableTest.ColumnFamilyOptionsAllFieldsSettable
options/options_settable_test.cc:568: Failure
Expected equality of these values:
  unset_bytes_base
    Which is: 115
  NumUnsetBytes(new_options_ptr, sizeof(ColumnFamilyOptions), kColumnFamilyOptionsExcluded)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, only one test failed. Updated to only skip that test.

@@ -269,7 +269,7 @@ Status BlobDBImpl::Open(std::vector<ColumnFamilyHandle*>* handles) {
// Add trash files in blob dir to file delete scheduler.
SstFileManagerImpl* sfm = static_cast<SstFileManagerImpl*>(
db_impl_->immutable_db_options().sst_file_manager.get());
DeleteScheduler::CleanupDirectory(env_, sfm, blob_dir_);
s = DeleteScheduler::CleanupDirectory(env_, sfm, blob_dir_);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change in non-unit-test code.

Copy link
Contributor

@hx235 hx235 Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest following the pattern in this function that if(!s.ok()) {return s;} (optionally with some error logging if you'd like) following a s=... as we can't guarantee s = DeleteScheduler::... is the last s of the function in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added status check and error logging.

utilities/blob_db/blob_db_listener.h Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cbi42 cbi42 requested a review from hx235 August 9, 2023 00:43
Copy link
Contributor

@hx235 hx235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change LGTM with some minor comments.

For the context, the ASC related failures do get surfaced only after #11675 but I don't really understand why ....

@cbi42
Copy link
Member Author

cbi42 commented Aug 9, 2023

The change LGTM with some minor comments.

For the context, the ASC related failures do get surfaced only after #11675 but I don't really understand why ....

The unit tests are compiled with -fno-elide-constructors only after the change #11675. The flag is set in

PLATFORM_CXXFLAGS += -fno-elide-constructors
but
include make_config.mk
overwrites it. As for why tests do not fail when -fno-elide-constructors is not set, I'm guessing Status construction is optimized away, as well as the ASC check in Status destructor .

@facebook-github-bot
Copy link
Contributor

@cbi42 has updated the pull request. You must reimport the pull request before landing.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@cbi42 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@cbi42 merged this pull request in 76ed9a3.

rockeet pushed a commit to topling/toplingdb that referenced this pull request Dec 18, 2023
…` (#11686)

Summary:
It seems the flag `-fno-elide-constructors` is incorrectly overwritten in Makefile by https://github.com/facebook/rocksdb/blob/9c2ebcc2c365bb89af566b3076f813d7bf11146b/Makefile#L243
Applying the change in PR facebook/rocksdb#11675 shows a lot of missing status checks. This PR adds the missing status checks.

Most of changes are just adding asserts in unit tests. I'll add pr comment around more interesting changes that need review.

Pull Request resolved: facebook/rocksdb#11686

Test Plan: change Makefile as in facebook/rocksdb#11675, and run `ASSERT_STATUS_CHECKED=1 TEST_UINT128_COMPAT=1 ROCKSDB_MODIFY_NPHASH=1 LIB_MODE=static OPT="-DROCKSDB_NAMESPACE=alternative_rocksdb_ns" make V=1 -j24 J=24 check`

Reviewed By: hx235

Differential Revision: D48176132

Pulled By: cbi42

fbshipit-source-id: 6758946cfb1c6ff84c4c1e0ca540d05e6fc390bd
rockeet pushed a commit to topling/toplingdb that referenced this pull request Sep 1, 2024
…` (#11686)

Summary:
It seems the flag `-fno-elide-constructors` is incorrectly overwritten in Makefile by https://github.com/facebook/rocksdb/blob/9c2ebcc2c365bb89af566b3076f813d7bf11146b/Makefile#L243
Applying the change in PR facebook/rocksdb#11675 shows a lot of missing status checks. This PR adds the missing status checks.

Most of changes are just adding asserts in unit tests. I'll add pr comment around more interesting changes that need review.

Pull Request resolved: facebook/rocksdb#11686

Test Plan: change Makefile as in facebook/rocksdb#11675, and run `ASSERT_STATUS_CHECKED=1 TEST_UINT128_COMPAT=1 ROCKSDB_MODIFY_NPHASH=1 LIB_MODE=static OPT="-DROCKSDB_NAMESPACE=alternative_rocksdb_ns" make V=1 -j24 J=24 check`

Reviewed By: hx235

Differential Revision: D48176132

Pulled By: cbi42

fbshipit-source-id: 6758946cfb1c6ff84c4c1e0ca540d05e6fc390bd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants