Skip to content
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