You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update invariant references in documentation for accuracy (#10)
* docs: update invariant references in documentation for accuracy
* refactor: update invariants and descriptions for clarity and consistency across documentation
* refactor: update invariants and documentation for cache consistency and rebalance execution
---------
Co-authored-by: Mykyta Zotov <mykyta.zotov@ihsmarkit.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,7 +224,7 @@ catch (Exception ex)
224
224
-**Strong consistency**: `GetDataAndWaitForIdleAsync` — always waits for idle regardless of `CacheInteraction`
225
225
226
226
**Serialized Access Requirement for Hybrid/Strong Modes:**
227
-
`GetDataAndWaitOnMissAsync` and `GetDataAndWaitForIdleAsync` provide their warm-cache guarantee only under **serialized (one-at-a-time) access**. Under parallel access, `WaitForIdleAsync`'s "was idle at some point" semantics (Invariant H.49) may return the old completed TCS, missing the rebalance triggered by the concurrent request. These methods remain safe (no crashes/hangs) but the guarantee degrades under parallelism.
227
+
`GetDataAndWaitOnMissAsync` and `GetDataAndWaitForIdleAsync` provide their warm-cache guarantee only under **serialized (one-at-a-time) access**. Under parallel access, `WaitForIdleAsync`'s "was idle at some point" semantics (Invariant H.3) may return the old completed TCS, missing the rebalance triggered by the concurrent request. These methods remain safe (no crashes/hangs) but the guarantee degrades under parallelism.
By default, `GetDataAsync` is **eventually consistent**: data is returned immediately while the cache window converges asynchronously in the background. Two opt-in extension methods provide stronger consistency guarantees. Both require a `using SlidingWindowCache.Public;` import.
404
404
405
-
> **Serialized access requirement:** The hybrid and strong consistency modes provide their warm-cache guarantee only when requests are made one at a time (serialized). Under concurrent/parallel callers they remain safe (no crashes or hangs) but the guarantee degrades — due to `AsyncActivityCounter`'s "was idle at some point" semantics (Invariant H.49) and a brief gap between the counter increment and TCS publication in `IncrementActivity`, a concurrent waiter may observe a previously completed idle TCS and return without waiting for the new rebalance.
405
+
> **Serialized access requirement:** The hybrid and strong consistency modes provide their warm-cache guarantee only when requests are made one at a time (serialized). Under concurrent/parallel callers they remain safe (no crashes or hangs) but the guarantee degrades — due to `AsyncActivityCounter`'s "was idle at some point" semantics (Invariant H.3) and a brief gap between the counter increment and TCS publication in `IncrementActivity`, a concurrent waiter may observe a previously completed idle TCS and return without waiting for the new rebalance.
| C.5 | Serial execution: at most one active rebalance at a time |
110
+
| F.1 | Multiple cancellation checkpoints: before I/O, after I/O, before mutation |
111
+
| F.1a | Cancellation-before-mutation guarantee |
112
+
| F.3 |`Rematerialize` accepts arbitrary range and data (full replacement) |
113
+
| F.4 | Incremental fetching: only missing subranges fetched |
114
+
| F.5 | Data preservation: existing cached data merged during expansion |
115
+
| G.3| I/O isolation: User Path MAY call `IDataSource`for U1/U5 (cold start / full miss); Rebalance Execution calls it for background normalization only|
0 commit comments