Repository navigation
Enable db_test running in Centos 32 bit OS and Alpine 32 bit OS - #9294
sike-evolve wants to merge 9 commits into
Conversation
|
Just to add that we have also prepared CircleCI jobs for testing this here - #7876 |
| thread[id].id = id; | ||
| thread[id].multiget_batched = multiget_batched_; | ||
| env_->StartThread(MTThreadBody, &thread[id]); | ||
| // Cannot use env_->StartThread because the thread needs to be detached. |
There was a problem hiding this comment.
This doesn't make sense. env_->StartThread only creates detached threads. If it's not working, it needs to be fixed.
And this code (probably ancient) would be much better off with joinable threads anyway.
There was a problem hiding this comment.
Already changed the code from detached threads to joinable threads
| ASSERT_OK(Put(0, "foo", "bar")); | ||
| BlockBasedTableOptions table_options; | ||
| table_options.block_size = 8LL * 1024 * 1024 * 1024LL; | ||
| table_options.block_size = (size_t)(8LL * 1024 * 1024 * 1024LL); |
There was a problem hiding this comment.
This is a weird way to construct a size_t, and you have made this a "bad" test because it's mandating--only on 32-bit--that block_size = 0 be accepted, which is weird.
Ideally we'd change block_size to uint64_t so that it's less error-prone, and that should also eliminate the need for special cases in test.
There was a problem hiding this comment.
Ideally we'd change block_size to uint64_t so that it's less error-prone, and that should also eliminate the need for special cases in test.
While technically a breaking change for source compatibility in obscure cases, it's the kind we would easily accept in a minor release.
There was a problem hiding this comment.
Already changed block_size from size_t to uint64_t.
| } else { | ||
| // Should not call Matches on unset Regex | ||
| assert(false); | ||
| // assert(false); |
There was a problem hiding this comment.
db_test fails in 32 bit platform.
[==========] Running 169 tests from 3 test cases.
[----------] Global test environment set-up.
[----------] 102 tests from DBTest
[ RUN ] DBTest.MockEnvTest
db_test: util/regex.cc:29: bool rocksdb::Regex::Matches(const string&) const: Assertion `false' failed.
Received signal 6 (Aborted)
There was a problem hiding this comment.
Removed the commented code. Please review it.
| SetFD_CLOEXEC(fd, &options); | ||
|
|
||
| if (options.use_mmap_reads && sizeof(void*) >= 8) { | ||
| // Remove 64 bit OS checking. Both 64 and 32 bit OSes use mmap to read files |
There was a problem hiding this comment.
I don't think we need to explain an old, unnatural state of the code here. That's what release notes are for.
| int id = t->id; | ||
| DB* db = t->state->test->db_; | ||
| int counter = 0; | ||
| auto start = std::chrono::high_resolution_clock::now(); |
There was a problem hiding this comment.
How about
std::shared_ptr<SystemClock> clock = SystemClock::Default();
auto end_micros = clock->NowMicros() + kTestSeconds * 1000000U;
...
while (clock->NowMicros() < end_micros) {
(And change kTestSeconds to unsigned)
| bool multiget_batched; | ||
| }; | ||
|
|
||
| // Based on Peter Dillinger's suggestion, the threads have been changed from |
There was a problem hiding this comment.
Not necessary. Thanks. Someone can use git blame if they want to see the history of this test.
| env_->SleepForMicroseconds(100000); | ||
| } | ||
| } | ||
| // Based on Peter Dillinger's suggestion, the threads have been changed from |
There was a problem hiding this comment.
Comment not necessary. Thanks
|
@pdillinger Now we have reconciled the Snappy issue to an older version of Snappy shipped on older versions of Alpine, are you happy with this PR? |
|
|
||
| // The default compaction method snappy does not work on Alpine 32 platform | ||
| // That means there is no compression | ||
| // The following test case has been disabled on 32 bit platform |
There was a problem hiding this comment.
Isn't this comment now obsolete?
There was a problem hiding this comment.
Now I removed this comment.
|
@pdillinger has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Loose ends relate to mmap on 32-bit systems. (Testing is more complicated when the feature is completely disabled on 32-bit.) Test Plan: CI
Summary: Loose ends relate to mmap on 32-bit systems. (Testing is more complicated when the feature was completely disabled on 32-bit.) Pull Request resolved: #9386 Test Plan: CI Reviewed By: ajkr Differential Revision: D33590715 Pulled By: pdillinger fbshipit-source-id: f2637036a538a552200adee65b6765fce8cae27b
) Summary: Loose ends relate to mmap on 32-bit systems. (Testing is more complicated when the feature was completely disabled on 32-bit.) Pull Request resolved: meta#9386 Test Plan: CI Reviewed By: ajkr Differential Revision: D33590715 Pulled By: pdillinger fbshipit-source-id: f2637036a538a552200adee65b6765fce8cae27b
Closes #9271