MB-19578: Fail warmup only when explicitly configured 53/67353/9
authorSriram Ganesan <sriram@couchbase.com>
Sat, 3 Sep 2016 23:49:53 +0000 (16:49 -0700)
committerSriram Ganesan <sriram@couchbase.com>
Thu, 29 Sep 2016 02:56:15 +0000 (02:56 +0000)
- Instead of unconditionally failing warmup in case of a OOM failure,
  fail it only when it is configured to do so. Note that ns_server
  explicitly sets this value to false.
- Remove an unnecessary check in the bucket initialization path to
  check for warmup failures as soon as warmup is started. The warmup
  process is asynchronous and thus checking for failures right away
  is futile.

Change-Id: I5725644a3731e7cd75e98b0b77ca6ae8a3d88ab9
Reviewed-on: http://review.couchbase.org/67353
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/ep.cc
src/ep_engine.cc

index 65dd055..57dcf15 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -419,13 +419,6 @@ bool EventuallyPersistentStore::initialize() {
 
     warmupTask->start();
 
-    if (config.isFailpartialwarmup() && stats.warmOOM > 0) {
-        LOG(EXTENSION_LOG_WARNING,
-            "Warmup failed to load %d records due to OOM, exiting.\n",
-            static_cast<unsigned int>(stats.warmOOM));
-        return false;
-    }
-
     itmpTask = new ItemPager(&engine, stats);
     ExecutorPool::get()->schedule(itmpTask, NONIO_TASK_IDX);
 
index 14b30d0..dbd6a7a 100644 (file)
@@ -5758,7 +5758,8 @@ EventuallyPersistentEngine::handleTrafficControlCmd(const void *cookie,
             // engine is still warming up, do not turn on data traffic yet
             msg << "Persistent engine is still warming up!";
             status = PROTOCOL_BINARY_RESPONSE_ETMPFAIL;
-        } else if (epstore->isWarmupOOMFailure()) {
+        } else if (configuration.isFailpartialwarmup() &&
+                   epstore->isWarmupOOMFailure()) {
             // engine has completed warm up, but data traffic cannot be
             // turned on due to an OOM failure
             msg << "Data traffic to persistent engine cannot be enabled"