Address possible data race during epstore's init
Address possible data race during epstore's init

Context: expiryPager.enabled

WARNING: ThreadSanitizer: data race (pid=32249)
  Read of size 1 at 0x7d540000fe08 by thread T8 (mutexes: write M10845):
    #0 EventuallyPersistentStore::isExpPagerEnabled() /home/abhinav/couchbase/ep-engine/src/ep.h:867:16 (ep.so+0x0000000b5980)
    #1 EventuallyPersistentEngine::doEngineStats(void const*, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:3556 (ep.so+0x0000000b5980)
    #2 EventuallyPersistentEngine::getStats(void const*, char const*, int, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:4570:14 (ep.so+0x0000000bc9a5)
    #3 EventuallyPersistentStore::snapshotStats() /home/abhinav/couchbase/ep-engine/src/ep.cc:1695:15 (ep.so+0x00000008828e)
    #4 StatSnap::run() /home/abhinav/couchbase/ep-engine/src/tasks.cc:98:5 (ep.so+0x00000012b3e6)
    #5 ExecutorThread::run() /home/abhinav/couchbase/ep-engine/src/executorthread.cc:115:26 (ep.so+0x0000000eb0bd)
    #6 launch_executor_thread(void*) /home/abhinav/couchbase/ep-engine/src/executorthread.cc:33:9 (ep.so+0x0000000eac85)
    #7 platform_thread_wrap /home/abhinav/couchbase/platform/src/cb_pthreads.c:23:5 (libplatform.so.0.1.0+0x000000004131)

  Previous write of size 1 at 0x7d540000fe08 by main thread:
    #0 EventuallyPersistentStore::initialize() /home/abhinav/couchbase/ep-engine/src/ep.cc:430:5 (ep.so+0x00000007c194)
    #1 EventuallyPersistentEngine::initialize(char const*) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:2169:10 (ep.so+0x0000000ae875)
    #2 EvpInitialize(engine_interface*, char const*) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:136:38 (ep.so+0x0000000ac158)
    #3 init_engine_instance /home/abhinav/couchbase/memcached/utilities/engine_loader.c:157:17 (libmcd_util.so.1.0.0+0x00000000580b)
    #4 create_bucket(bool, char const*) /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:980:17 (engine_testapp+0x0000004ba4e7)
    #5 execute_test(test, char const*, char const*) /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:1083:25 (engine_testapp+0x0000004b9bf9)
    #6 main /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:1439 (engine_testapp+0x0000004b9bf9)

Change-Id: Id1a4e00f2f0e97549deda8cc29cd818848bbfd0e
Reviewed-on: http://review.couchbase.org/56014
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>

couchbase/ep-engine,couchbase/ep-engine,daverigby/ep-engine,hisundar/ep-engine,membase/ep-engine,owendCB/ep-engine,daverigby/kv_engine,teligent-ru/ep-engine,hisundar/ep-engine,daverigby/kv_engine,daverigby/ep-engine,hisundar/ep-engine,teligent-ru/ep-engine,teligent-ru/ep-engine,daverigby/ep-engine,teligent-ru/ep-engine,daverigby/kv_engine,membase/ep-engine,couchbase/ep-engine,daverigby/ep-engine,couchbase/ep-engine,hisundar/ep-engine,daverigby/kv_engine,membase/ep-engine,owendCB/ep-engine,owendCB/ep-engine,owendCB/ep-engine,membase/ep-engine