Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
v01dstar committed Oct 5, 2024
1 parent 3dccaa1 commit eb7cf9a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 22 deletions.
5 changes: 5 additions & 0 deletions db/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4959,6 +4959,11 @@ size_t rocksdb_write_buffer_manager_dummy_entries_in_cache_usage(
return wbm->rep->dummy_entries_in_cache_usage();
}

size_t rocksdb_write_buffer_manager_flush_size(
rocksdb_write_buffer_manager_t* wbm) {
return wbm->rep->flush_size();
}

rocksdb_dbpath_t* rocksdb_dbpath_create(const char* path,
uint64_t target_size) {
rocksdb_dbpath_t* result = new rocksdb_dbpath_t;
Expand Down
8 changes: 1 addition & 7 deletions db/c_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3792,14 +3792,8 @@ int main(int argc, char** argv) {

CheckCondition(true ==
rocksdb_write_buffer_manager_enabled(write_buffer_manager));
CheckCondition(true == rocksdb_write_buffer_manager_cost_to_cache(
write_buffer_manager));
CheckCondition(
200 == rocksdb_write_buffer_manager_buffer_size(write_buffer_manager));

rocksdb_write_buffer_manager_set_buffer_size(write_buffer_manager, 300);
CheckCondition(
300 == rocksdb_write_buffer_manager_buffer_size(write_buffer_manager));
200 == rocksdb_write_buffer_manager_flush_size(write_buffer_manager));

rocksdb_write_buffer_manager_destroy(write_buffer_manager);
rocksdb_cache_destroy(lru);
Expand Down
4 changes: 3 additions & 1 deletion db/db_flush_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,11 @@ class TestFlushListener : public EventListener {
DBFlushTest* test_;
};

// Disabled, because of
// https://github.com/tikv/rocksdb/pull/389/commits/cc433939ed937a82d0a0ccad1280d5907b048654
TEST_F(
DBFlushTest,
FixUnrecoverableWriteDuringAtomicFlushWaitUntilFlushWouldNotStallWrites) {
DISABLED_FixUnrecoverableWriteDuringAtomicFlushWaitUntilFlushWouldNotStallWrites) {
Options options = CurrentOptions();
options.atomic_flush = true;

Expand Down
4 changes: 0 additions & 4 deletions file/writable_file_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ IOStatus WritableFileWriter::Append(const Slice& data, uint32_t crc32c_checksum,
io_options, nullptr);
}

// The buffer initialization code previously in ctor.
if (buf_.Capacity() == 0) {
buf_.AllocateNewBuffer(std::min((size_t)65536, max_buffer_size_));
}
// See whether we need to enlarge the buffer to avoid the flush
if (buf_.Capacity() - buf_.CurrentSize() < left) {
for (size_t cap = buf_.Capacity();
Expand Down
3 changes: 1 addition & 2 deletions file/writable_file_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ class WritableFileWriter {
TEST_SYNC_POINT_CALLBACK("WritableFileWriter::WritableFileWriter:0",
reinterpret_cast<void*>(max_buffer_size_));
buf_.Alignment(writable_file_->GetRequiredBufferAlignment());
// Moved to `Append` to reduce memory usage of unused writer.
// buf_.AllocateNewBuffer(std::min((size_t)65536, max_buffer_size_));
buf_.AllocateNewBuffer(std::min((size_t)65536, max_buffer_size_));
std::for_each(listeners.begin(), listeners.end(),
[this](const std::shared_ptr<EventListener>& e) {
if (e->ShouldBeNotifiedOnFileIO()) {
Expand Down
8 changes: 1 addition & 7 deletions include/rocksdb/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -2099,8 +2099,6 @@ extern ROCKSDB_LIBRARY_API void rocksdb_write_buffer_manager_destroy(
rocksdb_write_buffer_manager_t* wbm);
extern ROCKSDB_LIBRARY_API bool rocksdb_write_buffer_manager_enabled(
rocksdb_write_buffer_manager_t* wbm);
extern ROCKSDB_LIBRARY_API bool rocksdb_write_buffer_manager_cost_to_cache(
rocksdb_write_buffer_manager_t* wbm);
extern ROCKSDB_LIBRARY_API size_t
rocksdb_write_buffer_manager_memory_usage(rocksdb_write_buffer_manager_t* wbm);
extern ROCKSDB_LIBRARY_API size_t
Expand All @@ -2110,11 +2108,7 @@ extern ROCKSDB_LIBRARY_API size_t
rocksdb_write_buffer_manager_dummy_entries_in_cache_usage(
rocksdb_write_buffer_manager_t* wbm);
extern ROCKSDB_LIBRARY_API size_t
rocksdb_write_buffer_manager_buffer_size(rocksdb_write_buffer_manager_t* wbm);
extern ROCKSDB_LIBRARY_API void rocksdb_write_buffer_manager_set_buffer_size(
rocksdb_write_buffer_manager_t* wbm, size_t new_size);
extern ROCKSDB_LIBRARY_API void rocksdb_write_buffer_manager_set_allow_stall(
rocksdb_write_buffer_manager_t* wbm, bool new_allow_stall);
rocksdb_write_buffer_manager_flush_size(rocksdb_write_buffer_manager_t* wbm);

/* HyperClockCache */

Expand Down
2 changes: 1 addition & 1 deletion options/options_settable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ TEST_F(OptionsSettableTest, ColumnFamilyOptionsAllFieldsSettable) {
sizeof(std::shared_ptr<ConcurrentTaskLimiter>)},
{offsetof(struct ColumnFamilyOptions, sst_partitioner_factory),
sizeof(std::shared_ptr<SstPartitionerFactory>)},
{offset_of(&ColumnFamilyOptions::cf_write_buffer_manager),
{offsetof(struct ColumnFamilyOptions, cf_write_buffer_manager),
sizeof(std::shared_ptr<WriteBufferManager>)},
};

Expand Down

0 comments on commit eb7cf9a

Please sign in to comment.