From d91c1f96cce4fea7a4b385af6b7927f6f0f411b2 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Tue, 5 Aug 2014 12:50:12 -0700 Subject: [PATCH] Detect node store batch write failures (RIPD-270): * Raise open file limit from the soft max to the hard max. --- src/ripple/module/app/main/Main.cpp | 4 ++++ src/ripple/nodestore/backend/HyperDBFactory.cpp | 5 ++++- src/ripple/nodestore/backend/LevelDBFactory.cpp | 5 ++++- src/ripple/nodestore/backend/RocksDBFactory.cpp | 5 ++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/ripple/module/app/main/Main.cpp b/src/ripple/module/app/main/Main.cpp index e112e7114..98ac2c930 100644 --- a/src/ripple/module/app/main/Main.cpp +++ b/src/ripple/module/app/main/Main.cpp @@ -23,6 +23,10 @@ #include #include +#if defined(BEAST_LINUX) || defined(BEAST_MAC) || defined(BEAST_BSD) +#include +#endif + namespace po = boost::program_options; namespace ripple { diff --git a/src/ripple/nodestore/backend/HyperDBFactory.cpp b/src/ripple/nodestore/backend/HyperDBFactory.cpp index aa480c8e5..fb51abca7 100644 --- a/src/ripple/nodestore/backend/HyperDBFactory.cpp +++ b/src/ripple/nodestore/backend/HyperDBFactory.cpp @@ -172,7 +172,10 @@ public: hyperleveldb::WriteOptions const options; - m_db->Write (options, &wb).ok (); + auto ret = m_db->Write (options, &wb); + + if (!ret.ok ()) + throw std::runtime_error ("storeBatch failed: " + ret.ToString()); } void diff --git a/src/ripple/nodestore/backend/LevelDBFactory.cpp b/src/ripple/nodestore/backend/LevelDBFactory.cpp index 8fabbd9d5..2985cb328 100644 --- a/src/ripple/nodestore/backend/LevelDBFactory.cpp +++ b/src/ripple/nodestore/backend/LevelDBFactory.cpp @@ -174,7 +174,10 @@ public: leveldb::WriteOptions const options; - m_db->Write (options, &wb).ok (); + auto ret = m_db->Write (options, &wb); + + if (!ret.ok ()) + throw std::runtime_error ("storeBatch failed: " + ret.ToString()); } void diff --git a/src/ripple/nodestore/backend/RocksDBFactory.cpp b/src/ripple/nodestore/backend/RocksDBFactory.cpp index c657bb96c..db7d46f27 100644 --- a/src/ripple/nodestore/backend/RocksDBFactory.cpp +++ b/src/ripple/nodestore/backend/RocksDBFactory.cpp @@ -261,7 +261,10 @@ public: rocksdb::WriteOptions const options; - m_db->Write (options, &wb).ok (); + auto ret = m_db->Write (options, &wb); + + if (!ret.ok ()) + throw std::runtime_error ("storeBatch failed: " + ret.ToString()); } void