aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/structuredcachestore.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-08-17 17:16:18 +0200
committerGitHub <[email protected]>2023-08-17 17:16:18 +0200
commitd2887ce78b4fbbdb7e5e320877dfcf12c7524e69 (patch)
treedc5c7f0cc078219df49cb442f4842ea741130da3 /src/zenserver/cache/structuredcachestore.h
parentskip upstream logic early if we have no upstream endpoints (#359) (diff)
downloadzen-d2887ce78b4fbbdb7e5e320877dfcf12c7524e69.tar.xz
zen-d2887ce78b4fbbdb7e5e320877dfcf12c7524e69.zip
single thread async cache log (#361)
* rework cache store background jogging * correct capture for context
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.h')
-rw-r--r--src/zenserver/cache/structuredcachestore.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/zenserver/cache/structuredcachestore.h b/src/zenserver/cache/structuredcachestore.h
index 040b71c95..067cfc0bf 100644
--- a/src/zenserver/cache/structuredcachestore.h
+++ b/src/zenserver/cache/structuredcachestore.h
@@ -174,8 +174,22 @@ private:
GcManager& m_Gc;
Configuration m_Configuration;
- std::unique_ptr<WorkerThreadPool> m_AsyncLogging;
- Latch m_PendingAsyncLogging;
+ struct AccessLogItem
+ {
+ const char* Op;
+ CacheRequestContext Context;
+ std::string Namespace;
+ std::string Bucket;
+ IoHash HashKey;
+ ZenCacheValue Value;
+ };
+
+ void LogWorker();
+ RwLock m_LogQueueLock;
+ std::vector<AccessLogItem> m_LogQueue;
+ std::atomic_bool m_ExitLogging;
+ Event m_LogEvent;
+ std::thread m_AsyncLoggingThread;
};
void z$_forcelink();