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

Fix lose of be's meta data bug #318

Merged
merged 1 commit into from
Nov 15, 2018
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
8 changes: 6 additions & 2 deletions be/src/olap/olap_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ OLAPStatus OlapMeta::get(const int column_family_index, const std::string& key,

OLAPStatus OlapMeta::put(const int column_family_index, const std::string& key, const std::string& value) {
rocksdb::ColumnFamilyHandle* handle = _handles[column_family_index];
Status s = _db->Put(WriteOptions(), handle, Slice(key), Slice(value));
WriteOptions write_options;
write_options.sync = true;
Status s = _db->Put(write_options, handle, Slice(key), Slice(value));
if (!s.ok()) {
LOG(WARNING) << "rocks db put key:" << key << " failed, reason:" << s.ToString();
return OLAP_ERR_META_PUT;
Expand All @@ -109,7 +111,9 @@ OLAPStatus OlapMeta::put(const int column_family_index, const std::string& key,

OLAPStatus OlapMeta::remove(const int column_family_index, const std::string& key) {
rocksdb::ColumnFamilyHandle* handle = _handles[column_family_index];
Status s = _db->Delete(WriteOptions(), handle, Slice(key));
WriteOptions write_options;
write_options.sync = true;
Status s = _db->Delete(write_options, handle, Slice(key));
if (!s.ok()) {
LOG(WARNING) << "rocks db delete key:" << key << " failed, reason:" << s.ToString();
return OLAP_ERR_META_DELETE;
Expand Down