Vanzeren
c8cf1bf2fb
feat(checkpoint): checkpoint history cache ( #4638 )
...
* feat(checkpoint-cache): delta-mode checkpoint history cache with recursive compose
Read-only, invalidation-free cache for LangGraph delta-channel history
({writes, seed}) at the get_delta_channel_history choke point:
- database.checkpoint_cache config (memory|redis; max_entries 0=disabled;
redis bounded by TTL, Gateway/async only)
- memory LRU backend (copy-on-read, zero-serde hit path) and redis backend
(lazy import, degrades to all-miss on outage)
- CachedHistorySaver: recursive composition from the nearest warm ancestor
(depth budget 8), caching each level; depth-0 cold chains delegate one
inner fast-path walk. Entries keyed by immutable
(db, thread, ns, checkpoint_id, channel) — no invalidation, coherent
across workers
- provider wiring: wraps in delta mode only (async + sync), full mode
untouched; sync path is memory-only
- bench opt-in: DEERFLOW_CHECKPOINT_BENCH_HISTORY_CACHE=1
sqlite bench (500 updates, payload 2KB): write phase 2.28x at f=250,
1.32x at f=10; one delegated walk per thread cold start.
* chore(config): bump config_version to 32 for database.checkpoint_cache
The checkpoint history cache feature added the database.checkpoint_cache
section to config.example.yaml; bump the schema version so existing
deployments get the outdated-config warning and can run make config-upgrade.
* chore(helm): bump config_version to 32 in chart values and README
* fix(checkpoint-cache): purge thread history entries on delete paths
Addresses review on #4638 : delete_thread/prune removed source-of-truth
checkpoints but left the thread's materialized history payloads in the
cache (memory: until LRU eviction; redis: until TTL, default 1 day) — a
data-lifecycle gap for tenant offboarding / GDPR-style erasure.
- Cache contract gains thread-scoped adelete_thread/delete_thread
(lifecycle purge, not invalidation; entries remain immutable)
- Memory backend: stem scan over the LRU map; redis: SCAN MATCH + UNLINK,
outage degrades to TTL-bounded retention without raising
- CachedHistorySaver purges on delete_thread/adelete_thread and
prune/aprune (prune rewrites chains, so pre-prune histories must go);
delete_for_runs stays delegation-only (run->thread mapping unavailable,
no in-tree callers), documented in code
- ttl_seconds description documents the residual-retention window
- Tests: thread-scoped purge on both backends, saver-level delete/prune
purge, prefix-safety (t1 vs t10), redis outage degradation, and the
pinned no-purge behavior of delete_for_runs
* fix(checkpoint-cache): stable db identity, prefix-aware sync singleton, explicit zero TTL
Addresses Copilot review on #4638 :
- checkpoint_cache_db_hash now hashes the credential-free postgres
identity (host:port/database + schema): credential rotation no longer
changes the cache namespace (cold cache + orphaned keys until TTL).
Unparseable URLs fall back to the raw string.
- The sync-path memory cache singleton is also keyed by its key_prefix:
a namespace change (db identity change or operator override) recreates
the cache instead of leaving stale-prefix entries unreachable and
unpurgeable.
- ttl_seconds=0 is now an explicit, documented opt-out of redis expiry
(SET without EX; redis maxmemory policy only) instead of a silent
'ttl_seconds or None' coercion.
Tests: credential-rotation hash stability, unparseable-URL fallback,
prefix-change singleton recreation, same-prefix singleton reuse, and
zero-TTL wire behavior (ex=None).
---------
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-08-02 22:25:02 +08:00
..
2026-08-02 09:08:36 +08:00
2026-07-22 14:02:56 +08:00
2026-07-19 18:26:26 +08:00
2026-07-29 22:33:45 +08:00
2026-05-12 23:18:54 +08:00
2026-07-26 14:43:08 +08:00
2026-04-26 15:09:25 +08:00
2026-06-01 15:50:39 +08:00
2026-07-28 23:21:23 +08:00
2026-07-21 11:46:33 +08:00
2026-06-21 20:56:42 +08:00
2026-06-08 12:35:03 +08:00
2026-07-22 14:47:08 +08:00
2026-07-17 15:11:15 +08:00
2026-07-22 13:44:55 +08:00
2026-07-23 08:03:21 +08:00
2026-07-23 08:03:21 +08:00
2026-07-22 13:44:55 +08:00
2026-07-21 09:09:40 +08:00
2026-07-31 17:55:24 +08:00
2026-07-27 07:47:39 +08:00
2026-07-30 07:53:10 +08:00
2026-06-23 10:39:40 +08:00
2026-07-30 13:51:17 +08:00
2026-08-01 22:19:59 +08:00
2026-05-29 23:05:59 +08:00
2026-05-16 09:24:40 +08:00
2026-04-26 11:08:11 +08:00
2026-07-27 14:19:04 +08:00
2026-07-18 22:17:15 +08:00
2026-07-30 23:53:52 +08:00
2026-07-23 22:51:35 +08:00
2026-07-17 14:49:51 +08:00
2026-07-17 14:49:51 +08:00
2026-07-27 14:19:04 +08:00
2026-07-23 22:51:35 +08:00
2026-07-23 22:51:35 +08:00
2026-06-24 13:57:12 +08:00
2026-07-28 23:21:23 +08:00
2026-07-28 23:21:23 +08:00
2026-07-27 11:47:49 +08:00
2026-07-30 07:53:10 +08:00
2026-07-26 08:00:48 +08:00
2026-07-02 11:00:49 +08:00
2026-08-01 22:19:59 +08:00
2026-08-01 22:19:59 +08:00
2026-07-28 07:56:04 +08:00
2026-08-02 22:25:02 +08:00
2026-08-02 22:25:02 +08:00
2026-07-14 07:37:59 +08:00
2026-06-16 23:04:39 +08:00
2026-06-18 10:15:31 +08:00
2026-07-12 08:54:03 +08:00
2026-07-25 21:55:31 +08:00
2026-07-17 14:49:51 +08:00
2026-06-18 10:45:33 +08:00
2026-07-27 23:07:40 +08:00
2026-07-29 08:08:33 +08:00
2026-08-02 22:25:02 +08:00
2026-08-02 22:25:02 +08:00
2026-08-02 22:25:02 +08:00
2026-08-02 22:25:02 +08:00
2026-07-28 22:12:27 +08:00
2026-07-28 23:21:23 +08:00
2026-07-26 10:44:50 +08:00
2026-07-28 23:21:23 +08:00
2026-07-12 08:15:32 +08:00
2026-07-30 13:51:17 +08:00
2026-07-28 19:43:56 +08:00
2026-03-30 07:41:18 +08:00
2026-04-25 19:40:06 +08:00
2026-04-07 18:21:22 +08:00
2026-07-22 14:02:56 +08:00
2026-07-23 22:51:35 +08:00
2026-07-29 22:16:48 +08:00
2026-07-29 22:16:48 +08:00
2026-05-04 09:56:16 +08:00
2026-08-01 22:34:11 +08:00
2026-05-02 15:04:11 +08:00
2026-08-01 08:35:02 +08:00
2026-06-10 21:36:25 +08:00
2026-07-22 08:33:29 +08:00
2026-07-29 22:24:04 +08:00
2026-07-26 07:39:39 +08:00
2026-04-26 11:05:47 +08:00
2026-07-05 09:54:55 +08:00
2026-03-29 15:31:18 +08:00
2026-07-22 08:33:29 +08:00
2026-05-07 16:15:15 +08:00
2026-06-12 15:24:58 +08:00
2026-07-22 07:46:03 +08:00
2026-07-23 22:56:12 +08:00
2026-07-17 19:16:42 +08:00
2026-06-08 07:59:50 +08:00
2026-08-01 08:39:28 +08:00
2026-07-13 17:57:34 +08:00
2026-06-02 22:43:22 +08:00
2026-06-05 15:21:41 +08:00
2026-07-12 00:17:11 +08:00
2026-07-04 23:09:29 +08:00
2026-06-02 22:43:22 +08:00
2026-07-01 22:49:17 +08:00
2026-07-13 19:26:07 +08:00
2026-07-22 08:33:29 +08:00
2026-07-28 23:21:23 +08:00
2026-07-04 09:21:19 +08:00
2026-07-22 13:55:40 +08:00
2026-07-29 22:33:45 +08:00
2026-07-26 09:56:17 +08:00
2026-07-29 22:33:45 +08:00
2026-06-09 15:29:40 +08:00
2026-07-27 14:19:39 +08:00
2026-06-12 15:24:58 +08:00
2026-06-13 23:27:17 +08:00
2026-03-31 22:19:27 +08:00
2026-07-29 08:08:33 +08:00
2026-07-26 07:39:39 +08:00
2026-07-28 22:59:14 +08:00
2026-07-31 17:13:12 +08:00
2026-07-31 17:55:24 +08:00
2026-04-26 11:09:56 +08:00
2026-07-29 07:04:26 +08:00
2026-04-08 17:13:39 +08:00
2026-07-31 08:32:39 +08:00
2026-07-05 09:54:55 +08:00
2026-07-21 11:46:33 +08:00
2026-07-14 10:43:13 +08:00
2026-08-01 22:16:34 +08:00
2026-07-02 08:24:15 +08:00
2026-07-04 21:31:01 +08:00
2026-07-19 22:12:30 +08:00
2026-07-14 11:57:48 +08:00
2026-07-31 21:57:22 +08:00
2026-07-22 08:33:29 +08:00
2026-07-29 00:09:02 +08:00
2026-07-26 08:09:17 +08:00
2026-07-31 17:55:24 +08:00
2026-07-28 23:21:23 +08:00
2026-07-28 23:21:23 +08:00
2026-07-18 17:50:20 +08:00
2026-08-01 19:42:44 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-27 23:07:40 +08:00
2026-07-04 22:56:24 +08:00
2026-07-14 22:56:50 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-16 09:12:29 +08:00
2026-07-23 14:32:49 +08:00
2026-07-15 22:30:34 +08:00
2026-07-28 21:45:20 +08:00
2026-06-21 15:55:10 +08:00
2026-07-23 21:33:57 +08:00
2026-03-14 22:55:52 +08:00
2026-07-06 07:21:12 +08:00
2026-07-27 22:46:51 +08:00
2026-07-27 14:05:31 +08:00
2026-07-10 11:08:30 +08:00
2026-07-27 23:07:40 +08:00
2026-03-26 14:20:18 +08:00
2026-06-28 16:10:44 +08:00
2026-07-08 17:10:27 +08:00
2026-07-22 14:02:56 +08:00
2026-07-04 13:54:04 +08:00
2026-06-17 15:29:22 +08:00
2026-07-22 14:47:08 +08:00
2026-06-08 23:25:29 +08:00
2026-07-12 11:51:31 +08:00
2026-06-10 16:11:00 +08:00
2026-07-28 22:54:44 +08:00
2026-07-28 22:54:44 +08:00
2026-07-29 07:11:20 +08:00
2026-07-30 07:21:55 +08:00
2026-07-28 23:21:23 +08:00
2026-07-23 08:22:15 +08:00
2026-07-23 22:56:12 +08:00
2026-04-11 16:52:10 +08:00
2026-07-20 23:33:09 +08:00
2026-07-09 17:21:25 +08:00
2026-07-03 07:51:22 +08:00
2026-07-13 00:01:22 +08:00
2026-07-31 17:55:24 +08:00
2026-07-13 00:01:22 +08:00
2026-07-04 13:54:04 +08:00
2026-07-03 08:01:46 +08:00
2026-04-30 22:27:14 +08:00
2026-05-07 16:15:15 +08:00
2026-07-19 17:13:44 +08:00
2026-07-26 14:43:08 +08:00
2026-07-19 22:12:30 +08:00
2026-07-03 15:39:12 +08:00
2026-08-01 22:01:45 +08:00
2026-04-25 09:18:13 +08:00
2026-07-30 23:52:07 +08:00
2026-07-22 19:58:43 +08:00
2026-07-10 07:54:36 +08:00
2026-07-09 16:26:31 +08:00
2026-07-09 16:26:31 +08:00
2026-07-28 22:59:14 +08:00
2026-08-01 22:33:11 +08:00
2026-08-01 22:33:11 +08:00
2026-08-01 22:33:11 +08:00
2026-07-14 09:49:43 +08:00
2026-07-31 22:16:56 +08:00
2026-08-01 08:39:28 +08:00
2026-07-22 14:40:57 +08:00
2026-07-26 21:16:36 +08:00
2026-07-22 07:46:03 +08:00
2026-07-28 22:59:14 +08:00
2026-07-15 11:21:04 +08:00
2026-07-26 21:16:36 +08:00
2026-07-26 21:16:36 +08:00
2026-07-27 23:17:18 +08:00
2026-07-31 18:06:45 +08:00
2026-08-01 08:39:28 +08:00
2026-07-15 11:21:04 +08:00
2026-08-01 08:39:28 +08:00
2026-07-22 07:46:03 +08:00
2026-07-22 07:46:03 +08:00
2026-07-22 07:46:03 +08:00
2026-04-26 11:09:55 +08:00
2026-07-29 07:11:20 +08:00
2026-07-15 11:21:04 +08:00
2026-08-01 08:39:28 +08:00
2026-07-22 14:02:56 +08:00
2026-07-26 21:16:36 +08:00
2026-07-26 21:16:36 +08:00
2026-07-28 21:45:20 +08:00
2026-07-28 21:45:20 +08:00
2026-07-27 23:07:40 +08:00
2026-07-04 13:54:04 +08:00
2026-07-17 14:23:44 +08:00
2026-07-31 21:57:22 +08:00
2026-07-31 21:57:22 +08:00
2026-07-26 14:43:08 +08:00
2026-07-26 14:43:08 +08:00
2026-08-01 22:34:11 +08:00
2026-07-31 17:55:24 +08:00
2026-07-27 23:07:40 +08:00
2026-07-26 21:45:47 +08:00
2026-07-28 21:45:20 +08:00
2026-06-22 18:55:20 +08:00
2026-08-01 22:19:59 +08:00
2026-07-18 17:48:42 +08:00
2026-06-21 15:47:53 +08:00
2026-05-28 08:20:52 +08:00
2026-07-29 07:24:55 +08:00
2026-07-11 16:05:30 +08:00
2026-07-04 21:44:22 +08:00
2026-05-28 18:24:32 +08:00
2026-06-08 22:04:38 +08:00
2026-03-26 15:07:05 +08:00
2026-06-09 18:01:43 +08:00
2026-07-26 08:09:17 +08:00
2026-06-24 13:57:12 +08:00
2026-07-28 21:45:20 +08:00
2026-06-24 13:57:12 +08:00
2026-07-28 21:45:20 +08:00
2026-06-24 13:57:12 +08:00
2026-07-30 13:51:17 +08:00
2026-07-28 21:45:20 +08:00
2026-07-30 13:51:17 +08:00
2026-06-24 13:57:12 +08:00
2026-07-30 13:51:17 +08:00
2026-05-21 16:22:09 +08:00
2026-07-30 13:51:17 +08:00
2026-07-29 08:08:33 +08:00
2026-07-30 13:51:17 +08:00
2026-04-26 11:13:01 +08:00
2026-07-20 07:24:34 +08:00
2026-04-10 20:40:30 +08:00
2026-07-26 08:09:17 +08:00
2026-07-31 17:55:24 +08:00
2026-08-01 19:42:44 +08:00
2026-07-21 09:23:14 +08:00
2026-07-06 20:57:41 +08:00
2026-07-30 07:53:10 +08:00
2026-07-30 07:53:10 +08:00
2026-03-14 22:55:52 +08:00
2026-03-14 22:55:52 +08:00
2026-07-03 08:01:46 +08:00
2026-07-28 22:54:44 +08:00
2026-06-08 17:32:41 +08:00
2026-06-09 21:58:31 +08:00
2026-07-14 23:08:33 +08:00
2026-07-11 15:58:07 +08:00
2026-07-25 23:50:21 +08:00
2026-06-24 17:47:04 +08:00
2026-07-02 07:43:09 +08:00
2026-04-26 15:09:25 +08:00
2026-08-01 19:42:44 +08:00
2026-07-23 21:33:57 +08:00
2026-07-28 21:31:23 +08:00
2026-07-28 23:29:14 +08:00
2026-07-26 21:57:39 +08:00
2026-07-28 21:31:23 +08:00
2026-05-21 14:48:28 +08:00
2026-07-28 21:45:20 +08:00
2026-07-27 22:27:16 +08:00
2026-07-27 22:27:16 +08:00
2026-07-27 11:32:10 +08:00
2026-07-28 21:45:20 +08:00
2026-08-01 19:42:44 +08:00
2026-06-24 10:24:36 +08:00
2026-07-22 08:33:29 +08:00
2026-07-19 22:12:30 +08:00
2026-07-23 22:56:12 +08:00
2026-07-23 22:56:12 +08:00
2026-05-22 21:20:28 +08:00
2026-08-01 21:44:34 +08:00
2026-06-03 22:02:27 +08:00
2026-07-30 07:53:10 +08:00
2026-04-09 17:21:23 +08:00
2026-07-26 09:47:57 +08:00
2026-07-21 09:09:40 +08:00
2026-07-13 18:34:41 +08:00
2026-06-25 08:06:17 +08:00
2026-07-28 07:49:13 +08:00
2026-07-30 07:53:10 +08:00
2026-07-04 13:54:04 +08:00
2026-06-12 10:20:38 +08:00
2026-07-04 21:51:57 +08:00
2026-07-24 21:41:09 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-24 21:41:09 +08:00
2026-08-01 19:42:44 +08:00
2026-07-04 21:51:57 +08:00
2026-07-31 17:27:51 +08:00
2026-08-01 19:42:44 +08:00
2026-06-12 09:45:26 +08:00
2026-07-21 23:41:07 +08:00
2026-06-19 11:23:07 +08:00
2026-03-26 14:20:18 +08:00
2026-07-21 08:15:33 +08:00
2026-06-27 23:30:54 +08:00
2026-07-07 23:09:06 +08:00
2026-07-23 08:03:21 +08:00
2026-05-12 23:18:54 +08:00
2026-07-23 08:03:21 +08:00
2026-07-05 19:55:39 +08:00
2026-06-19 21:57:03 +08:00
2026-07-04 23:09:29 +08:00
2026-07-04 11:27:19 +08:00
2026-07-04 11:27:19 +08:00
2026-07-04 23:09:29 +08:00
2026-07-31 17:55:24 +08:00
2026-07-13 10:40:22 +08:00
2026-05-28 15:48:32 +08:00
2026-07-17 14:39:35 +08:00
2026-07-31 17:55:24 +08:00
2026-07-28 21:31:23 +08:00
2026-07-24 21:25:53 +08:00
2026-07-11 15:58:07 +08:00
2026-07-04 13:54:04 +08:00
2026-07-16 14:12:02 +08:00
2026-03-25 16:28:33 +08:00
2026-07-16 14:12:02 +08:00
2026-07-31 17:55:24 +08:00
2026-07-19 22:36:15 +08:00
2026-07-16 14:12:02 +08:00
2026-07-04 23:09:29 +08:00
2026-07-17 23:22:16 +08:00
2026-07-31 17:55:24 +08:00
2026-07-24 21:25:53 +08:00
2026-07-21 00:02:16 +08:00
2026-06-18 10:09:46 +08:00
2026-07-08 21:58:33 +08:00
2026-07-29 22:39:48 +08:00
2026-07-28 22:59:14 +08:00
2026-03-30 16:02:23 +08:00
2026-07-31 17:25:07 +08:00
2026-07-22 09:20:54 +08:00
2026-07-27 07:13:06 +08:00
2026-06-14 10:30:45 +08:00
2026-06-08 23:17:22 +08:00
2026-07-14 08:14:21 +08:00
2026-07-28 23:29:14 +08:00
2026-07-24 21:56:11 +08:00
2026-07-30 07:21:55 +08:00
2026-07-30 07:21:55 +08:00
2026-05-02 06:37:49 +08:00
2026-07-11 15:41:57 +08:00
2026-07-11 15:41:57 +08:00
2026-07-13 19:26:07 +08:00
2026-06-19 21:42:42 +08:00
2026-07-28 19:35:21 +08:00
2026-07-26 07:39:39 +08:00
2026-07-07 19:55:33 +08:00
2026-07-27 11:47:49 +08:00
2026-07-27 11:47:49 +08:00
2026-08-01 19:42:44 +08:00
2026-06-24 07:28:17 +08:00
2026-07-23 22:56:12 +08:00
2026-05-21 21:18:10 +08:00
2026-06-18 10:15:31 +08:00
2026-07-28 07:49:13 +08:00
2026-07-11 15:53:14 +08:00
2026-07-28 22:59:14 +08:00
2026-08-01 19:42:44 +08:00
2026-08-01 19:42:44 +08:00
2026-07-27 22:46:51 +08:00
2026-07-27 22:46:51 +08:00
2026-07-27 22:18:02 +08:00
2026-07-28 22:15:09 +08:00
2026-07-29 12:47:30 +08:00
2026-07-27 22:46:51 +08:00
2026-06-02 22:43:22 +08:00
2026-07-22 08:33:29 +08:00
2026-07-31 21:57:22 +08:00
2026-07-28 23:21:23 +08:00
2026-08-01 19:42:44 +08:00
2026-07-31 17:55:24 +08:00
2026-07-15 11:21:04 +08:00
2026-03-14 22:55:52 +08:00
2026-07-11 23:15:03 +08:00
2026-06-12 22:48:47 +08:00
2026-07-08 22:26:06 +08:00
2026-07-04 23:14:46 +08:00
2026-05-10 22:00:57 +08:00
2026-06-23 23:37:41 +08:00
2026-07-28 23:21:23 +08:00
2026-07-27 22:46:51 +08:00
2026-05-19 22:11:46 +08:00
2026-07-28 23:29:14 +08:00
2026-07-04 11:27:19 +08:00
2026-07-16 16:41:04 +08:00
2026-04-06 15:09:57 +08:00
2026-07-06 20:57:41 +08:00
2026-07-06 20:57:41 +08:00
2026-07-12 11:24:24 +08:00
2026-07-14 09:49:43 +08:00
2026-07-19 09:13:51 +08:00
2026-07-19 09:13:51 +08:00
2026-07-14 08:58:06 +08:00
2026-07-14 08:58:06 +08:00
2026-07-03 08:01:46 +08:00
2026-07-22 07:53:50 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-07-22 07:53:50 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-07-15 22:27:00 +08:00
2026-06-25 20:10:49 +08:00
2026-07-20 23:56:37 +08:00
2026-05-12 23:18:54 +08:00
2026-07-23 08:03:21 +08:00
2026-07-26 21:16:36 +08:00
2026-07-26 21:16:36 +08:00
2026-07-01 16:43:56 +08:00
2026-07-28 22:59:14 +08:00
2026-07-28 23:41:14 +08:00
2026-07-28 22:59:14 +08:00
2026-07-31 17:55:24 +08:00
2026-07-11 09:18:12 +08:00
2026-07-14 10:43:13 +08:00
2026-05-02 15:16:16 +08:00
2026-06-09 15:29:40 +08:00
2026-07-22 08:41:50 +08:00
2026-07-24 13:12:43 +08:00
2026-07-28 19:56:40 +08:00
2026-07-27 07:13:06 +08:00
2026-07-06 07:21:12 +08:00
2026-07-20 23:05:47 +08:00
2026-07-18 17:53:30 +08:00
2026-07-12 07:52:45 +08:00
2026-07-28 21:45:20 +08:00
2026-07-28 21:45:20 +08:00
2026-07-12 11:51:31 +08:00
2026-07-27 22:27:16 +08:00
2026-06-07 17:47:11 +08:00