From 1f17066d50b035dae867e85a8ae8b927eec2387e Mon Sep 17 00:00:00 2001 From: haolifei Date: Wed, 23 Mar 2016 11:33:52 +0800 Subject: [PATCH 1/3] modify Makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index fe041558..65dcf60e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ OPT ?= -g2 -Wall -Werror # (B) Debug mode, w/ full line-level debugging symbols # Thirdparty include depends.mk +# CC = gcc CXX = g++ From 0b2e53d135fe260fbdcbbb0f67d79af6a6838264 Mon Sep 17 00:00:00 2001 From: haolifei Date: Wed, 23 Mar 2016 13:18:10 +0800 Subject: [PATCH 2/3] pod-persistence with option sync = true --- src/agent/persistence_handler.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/agent/persistence_handler.cc b/src/agent/persistence_handler.cc index 0a60e966..0dd9f04f 100644 --- a/src/agent/persistence_handler.cc +++ b/src/agent/persistence_handler.cc @@ -60,9 +60,11 @@ bool PersistenceHandler::SavePodInfo(const PodInfo& pod_info) { return false; } + + leveldb::WriteOptions ops; + ops.sync = true; leveldb::Status write_status = - persistence_handler_->Put(leveldb::WriteOptions(), - key, value); + persistence_handler_->Put(ops, key, value); if (!write_status.ok()) { LOG(WARNING, "persistence for pod %s write failed %s", key.c_str(), @@ -123,8 +125,10 @@ bool PersistenceHandler::DeletePodInfo(const std::string& pod_id) { return false; } std::string key = pod_id; + leveldb::WriteOptions ops; + ops.sync = true; leveldb::Status status = - persistence_handler_->Delete(leveldb::WriteOptions(), key); + persistence_handler_->Delete(ops, key); if (!status.ok()) { LOG(WARNING, "delete pod %s failed %s", key.c_str(), From 59b8db6c17db53df45ea361b0aecd6153c48438d Mon Sep 17 00:00:00 2001 From: haolifei Date: Wed, 23 Mar 2016 13:25:40 +0800 Subject: [PATCH 3/3] recover Makefile, keep same with baidu/galaxy --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 65dcf60e..fe041558 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,6 @@ OPT ?= -g2 -Wall -Werror # (B) Debug mode, w/ full line-level debugging symbols # Thirdparty include depends.mk -# CC = gcc CXX = g++