-
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
Enable db_test running in Centos 32 bit OS and Alpine 32 bit OS #9294
Changes from 5 commits
6d70def
18209e8
1e3137a
37f1df0
1a9afac
6e6c4d2
fe18292
bd55846
550be57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2743,7 +2743,10 @@ TEST_P(MultiThreadedDBTest, MultiThreaded) { | |
thread[id].state = &mt; | ||
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 is no function in env_ to detach the thread. | ||
// std::thread can be used in multiple OSes | ||
std::thread(MTThreadBody, &thread[id]).detach(); | ||
} | ||
|
||
// Let them run for a while | ||
|
@@ -4911,8 +4914,12 @@ TEST_F(DBTest, DynamicLevelCompressionPerLevel) { | |
ASSERT_OK(dbfull()->TEST_WaitForCompact()); | ||
ASSERT_EQ(NumTableFilesAtLevel(1), 0); | ||
ASSERT_EQ(NumTableFilesAtLevel(2), 0); | ||
ASSERT_LT(SizeAtLevel(0) + SizeAtLevel(3) + SizeAtLevel(4), | ||
120U * 4000U + 50U * 24); | ||
// The default compaction method snappy does not work on Alpine 32 platform | ||
pdillinger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// This test case has been disabled on 32 bit platform | ||
if (sizeof(void*) >= 8) { | ||
ASSERT_LT(SizeAtLevel(0) + SizeAtLevel(3) + SizeAtLevel(4), | ||
120U * 4000U + 50U * 24); | ||
} | ||
// Make sure data in files in L3 is not compacted by removing all files | ||
// in L4 and calculate number of rows | ||
ASSERT_OK(dbfull()->SetOptions({ | ||
|
@@ -6836,9 +6843,15 @@ TEST_F(DBTest, LargeBlockSizeTest) { | |
CreateAndReopenWithCF({"pikachu"}, options); | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already changed block_size from size_t to uint64_t. |
||
options.table_factory.reset(NewBlockBasedTableFactory(table_options)); | ||
ASSERT_NOK(TryReopenWithColumnFamilies({"default", "pikachu"}, options)); | ||
// size_t in 32 bit OS is defined as unsigned integer | ||
// It cannot make large block size in 32 bit OS | ||
if (sizeof(table_options.block_size) >= 8) { | ||
ASSERT_NOK(TryReopenWithColumnFamilies({"default", "pikachu"}, options)); | ||
} else { | ||
ASSERT_OK(TryReopenWithColumnFamilies({"default", "pikachu"}, options)); | ||
} | ||
} | ||
|
||
#ifndef ROCKSDB_LITE | ||
|
@@ -6979,8 +6992,9 @@ TEST_F(DBTest, MemoryUsageWithMaxWriteBufferSizeToMaintain) { | |
if ((size_all_mem_table > cur_active_mem) && | ||
(cur_active_mem >= | ||
static_cast<uint64_t>(options.max_write_buffer_size_to_maintain)) && | ||
(size_all_mem_table > options.max_write_buffer_size_to_maintain + | ||
options.write_buffer_size)) { | ||
(size_all_mem_table > | ||
static_cast<uint64_t>(options.max_write_buffer_size_to_maintain) + | ||
options.write_buffer_size)) { | ||
ASSERT_FALSE(memory_limit_exceeded); | ||
memory_limit_exceeded = true; | ||
} else { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,7 +238,11 @@ class PosixFileSystem : public FileSystem { | |
} | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to explain an old, unnatural state of the code here. That's what release notes are for. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
// There is one issue for 32 bit OS if PosixRandomAccessFile is used to read | ||
// files - Here is the comments | ||
// https://github.com/facebook/rocksdb/issues/9271#issuecomment-991230315 | ||
if (options.use_mmap_reads) { | ||
// Use of mmap for random reads has been removed because it | ||
// kills performance when storage is fast. | ||
// Use mmap when virtual address-space is plentiful. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ bool Regex::Matches(const std::string &str) const { | |
return std::regex_match(str, *impl_); | ||
} else { | ||
// Should not call Matches on unset Regex | ||
assert(false); | ||
// assert(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. db_test fails in 32 bit platform. [==========] Running 169 tests from 3 test cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be resolved by #9264. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the commented code. Please review it. |
||
return false; | ||
} | ||
} | ||
|
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already changed the code from detached threads to joinable threads