Commit 7750cf8
committed
fixup! Implement tiered storage
Previously, the implementations for `list` and paginated listing on `TierStore`
contained a bug where, if the ephemeral store was configured, these operations
could return only keys from the ephemeral tier for shared root namespaces such
as ("", ""). This meant durable keys saved to the primary store could be ignored
whenever their namespace was shared with ephemeral-cached keys.
While the solution to `list` seemed straightforward, the one for paginated
listing raised questions about the potential difference in store types between
the primary and ephemeral stores, and the conflict that would arise from them
having independent pagination orders and tokens. `TierStore`, as currently
designed, does not maintain a cross-store cursor, so we rely on a simple overlay
strategy: paginate through primary first, then append ephemeral keys once primary
is on its terminal page.
This does mean the resulting paginated listing is not a strict cross-store
creation-order merge: ephemeral keys are returned after primary pagination is
exhausted, regardless of their creation order in the ephemeral store. We accept
that tradeoff because `TierStore` has no shared creation order across backing
stores, and the overlay is bounded to the current ephemeral-cached key set.
This commit allows us to merge listings across `TierStore`'s primary and
ephemeral tiers by treating the latter as an overlay for ephemeral-cached keys
only. We filter stale primary copies of ephemeral-cached keys, append live
ephemeral copies once primary pagination is complete, and only consult the
ephemeral store for namespaces that can contain ephemeral-cached keys.1 parent cb0035a commit 7750cf8
3 files changed
Lines changed: 466 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
0 commit comments