imay closed pull request #318: Fix lose of be's meta data bug
URL: https://github.com/apache/incubator-doris/pull/318
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/be/src/olap/olap_meta.cpp b/be/src/olap/olap_meta.cpp
index d201dbfb..e348dd5f 100755
--- a/be/src/olap/olap_meta.cpp
+++ b/be/src/olap/olap_meta.cpp
@@ -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;
@@ -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;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to