diff options
author | Simon Rettberg | 2018-07-09 23:42:06 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-07-09 23:42:06 +0200 |
commit | 2507c2bbf312ba34200719842997f5d272d71777 (patch) | |
tree | 6d794b4eeb76c0c5308a2d00d6164ef438094f94 /src/server/globals.h | |
parent | [SERVER] Reduce debug spam (diff) | |
download | dnbd3-2507c2bbf312ba34200719842997f5d272d71777.tar.gz dnbd3-2507c2bbf312ba34200719842997f5d272d71777.tar.xz dnbd3-2507c2bbf312ba34200719842997f5d272d71777.zip |
[SERVER] Introduce backgroundReplication=hashblock
This is a compromise; if you want to validate replicated data fairly
quickly, using this option will make background replication only kick in
when there's a "dirty" 16M block, i.e. some blocks within a 16M block
are cached locally, but not all. Completing the block makes it possible
to validate its CRC32 checksum.
Diffstat (limited to 'src/server/globals.h')
-rw-r--r-- | src/server/globals.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/globals.h b/src/server/globals.h index 2fd1af2..e82ea1b 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -67,6 +67,7 @@ struct _dnbd3_connection bool replicatedLastBlock; // bool telling if the last block has been replicated yet bool cycleDetected; // connection cycle between proxies detected for current remote server int nextReplicationIndex; // Which index in the cache map we should start looking for incomplete blocks at + // If BGR == BGR_HASHBLOCK, -1 means "currently no incomplete block" uint64_t replicationHandle; // Handle of pending replication request uint64_t bytesReceived; // Number of bytes received by the connection. uint64_t lastBytesReceived; // Number of bytes received last time we updated the global counter. @@ -205,7 +206,10 @@ extern bool _closeUnusedFd; * Should we replicate incomplete images in the background? * Otherwise, only blocks that were explicitly requested will be cached. */ -extern bool _backgroundReplication; +extern int _backgroundReplication; +#define BGR_DISABLED (0) +#define BGR_FULL (1) +#define BGR_HASHBLOCK (2) /** * Minimum connected clients for background replication to kick in |