zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd <bit1...@163.com>
Subject A question about the configuration parameter:dataDir
Date Sat, 01 Nov 2014 00:32:30 GMT

The following is cited from the zookeeper book by Flavio Junqueira and Benjamin Reed:

dataDir is the directory where the fuzzy snapshots of the in-memory database willbe stored.
If this server is part of an ensemble, the myid file will also be in this directory.
The dataDir does not need to reside on a dedicated device. The snapshots are written using
a background thread that does not lock the database, and the writes to storage are not synced
until the snapshot is complete.

I don't quiet understand The snapshots are written using a background thread that does not
lock the database.Does it mean that the in memory database is not locked while the background
thread reads it and writes the snapshot to dataDir? If this is the case, then if the in-memory
data keeps changing while the background thread reads it, then there must be some mechanism
for the snapshot to write completely and correctly(one scenario is the data that the thread
has just read,but the in-memory database has just changed it).

Also I don't understand the writes to storage are not synced until the snapshot is complete,
what's the process of writing to storage, snapshot complets,sync.

Can someone explain more?Thanks.



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message