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

refactor: use rocksdb_wrapper to reimplement empty_put #670

Merged
merged 3 commits into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/server/pegasus_write_service_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,14 @@ class pegasus_write_service::impl : public dsn::replication::replica_base

int empty_put(int64_t decree)
{
int err = db_write_batch_put(decree, dsn::string_view(), dsn::string_view(), 0);
int err =
_rocksdb_wrapper->write_batch_put(decree, dsn::string_view(), dsn::string_view(), 0);
auto cleanup = dsn::defer([this]() { _rocksdb_wrapper->clear_up_write_batch(); });
if (err) {
clear_up_batch_states(decree, err);
return err;
}

err = db_write(decree);

clear_up_batch_states(decree, err);
err = _rocksdb_wrapper->write(decree);
return err;
}

Expand Down