citusdata / citusdata/pg_shard
Let CitusDB invalidate pg_shard's shard interval cache
- Dominant language
- C
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
`pg_shard` keeps a cache of shard interval metadata within each session which is _never_ refreshed. Within `pg_shard` this is fine, since all shards are created up front: caching forever isn't wrong. But now that Citus integration is more full-fledged, we're noticing that things like appending new shards or rebalancing existing ones results in `pg_shard` operating using stale metadata.
We need to come up with some sort of contract to let other pieces of software tell `pg_shard` about changes in the shard intervals of a distributed table. We may be able to reuse some existing pieces of invalidation logic within PostgreSQL, but that requires some reading to determine.
Contributor guide
Assessment
This issue has not been assessed yet.