Clear the Quick Search config cache on every node (ClusterCaches) #62

Merged
KofTwentyTwo merged 2 commits from feature/cluster-caches into develop 2026-10-15 19:11:18 +00:00
KofTwentyTwo commented 2026-10-15 17:10:54 +00:00 (Migrated from github.com)

What

Makes Quick Search correct on multi-node deployments (QQQ cluster HA spec, item 4 and owner decision 1).

Cache Decision Why
QuickSearchRuntime config cache: QuickSearchConfigStore snapshot + settings, and enabledCache (per-table enabled flags) shared as qbit-quick-search.config Backed by quick_search_index, quick_search_index_field and quick_search_settings rows that admins and config processes edit at runtime.
QuickSearchFieldRules.WARNED_TABLES node-local Warn-once log de-duplication for this node's table metadata objects.
  • The runtime caches are per-runtime instance fields, so a static weak set of live runtimes is registered with ClusterCaches.shared(...); a cluster invalidation clears every live runtime on the node.
  • QuickSearchRuntime.invalidateConfig() (called by the three config table customizers and the config processes) now clears locally and publishes ClusterCaches.invalidate("qbit-quick-search.config").
  • The 30 s config TTL and the 60 s enabled-flag TTL stay as the safety net when the cluster bus is down.

Tests

  • New QuickSearchClusterCachesTest: ClusterCacheAudit.unregisteredStaticCaches("com.kingsrook.qbits.quicksearch") is empty; a remote memo-invalidate event (origin node-b over a test wire transport) clears this node's cache; invalidateConfig() publishes the event from node-a.
  • ./mvnw -o verify (with -Denforcer.skip=true, see below): 543 unit tests and 45 integration tests pass, coverage checks met.

Release note: QQQ dependency

ClusterCaches is only in QQQ 4.1.0-SNAPSHOT today (merged in qqq#1228; not in 4.1.0-RC.12). This PR sets the one-line property qqq.snapshot.version to 4.1.0-SNAPSHOT. The G7 guardrail (no SNAPSHOT QQQ dependencies) will fail CI until that property points at the QQQ RC that ships ClusterCaches. Before merging or releasing, change qqq.snapshot.version to that RC. Never release with the SNAPSHOT.

🤖 Generated with Claude Code

## What Makes Quick Search correct on multi-node deployments (QQQ cluster HA spec, item 4 and owner decision 1). | Cache | Decision | Why | |---|---|---| | `QuickSearchRuntime` config cache: `QuickSearchConfigStore` snapshot + settings, and `enabledCache` (per-table enabled flags) | **shared** as `qbit-quick-search.config` | Backed by `quick_search_index`, `quick_search_index_field` and `quick_search_settings` rows that admins and config processes edit at runtime. | | `QuickSearchFieldRules.WARNED_TABLES` | **node-local** | Warn-once log de-duplication for this node's table metadata objects. | - The runtime caches are per-runtime instance fields, so a static weak set of live runtimes is registered with `ClusterCaches.shared(...)`; a cluster invalidation clears every live runtime on the node. - `QuickSearchRuntime.invalidateConfig()` (called by the three config table customizers and the config processes) now clears locally **and** publishes `ClusterCaches.invalidate("qbit-quick-search.config")`. - The 30 s config TTL and the 60 s enabled-flag TTL stay as the safety net when the cluster bus is down. ## Tests - New `QuickSearchClusterCachesTest`: `ClusterCacheAudit.unregisteredStaticCaches("com.kingsrook.qbits.quicksearch")` is empty; a remote memo-invalidate event (origin node-b over a test wire transport) clears this node's cache; `invalidateConfig()` publishes the event from node-a. - `./mvnw -o verify` (with `-Denforcer.skip=true`, see below): 543 unit tests and 45 integration tests pass, coverage checks met. ## Release note: QQQ dependency `ClusterCaches` is only in QQQ `4.1.0-SNAPSHOT` today (merged in qqq#1228; not in 4.1.0-RC.12). This PR sets the one-line property `qqq.snapshot.version` to `4.1.0-SNAPSHOT`. The G7 guardrail (no SNAPSHOT QQQ dependencies) will fail CI until that property points at the QQQ RC that ships `ClusterCaches`. **Before merging or releasing, change `qqq.snapshot.version` to that RC.** Never release with the SNAPSHOT. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.