Compatibility
This page documents the API scope, resource bounds, deliberate behavioral differences, and verification evidence for pgetcd v0.1.0-rc2 (local tag on commit 81691bc, verified on 2026-11-08) and the earlier 2026-10-08 frozen acceptance candidate (0.1.0-p1). v0.1.0-rc1 (commit 250df4c) is superseded; its results are kept where noted.
MVP scope
pgetcd provides a subset of the etcd v3 gRPC API backed by a single PostgreSQL 18 primary.
| Area | Supported in v0.1.0-rc2 |
|---|---|
| Deployment | One PostgreSQL 18 primary; one gateway process per tenant; one database and one SQL role per tenant |
| KV | Range, Put, DeleteRange, and Txn, including historical reads, comparisons, nested branches, and prev_kv |
| Compaction | Compact, logical compaction only |
| Leases | LeaseGrant, LeaseRevoke, LeaseTimeToLive, LeaseLeases, and LeaseKeepAlive |
| Watch | Multiple watches per stream, start revisions, filters, prev_kv, progress notification, fragmentation, and reconnect |
| Cluster and maintenance | MemberList and Status, reporting one logical tenant member; the Alarm list query, which returns an empty list |
| Client authentication | Mutual TLS with client certificate URI SAN spiffe://pgetcd/tenant/<tenant> |
| Platforms | Linux amd64 and arm64; PostgreSQL 18.6 |
Target use cases for the MVP:
- Applications using the official etcd Go
clientv3oretcdctl(configuration, service discovery, and Lease-backed coordination). - Kubernetes
kube-apiserverstorage for small clusters or development and test clusters.
Not supported in v0.1.0-rc2:
- Unimplemented RPCs (return gRPC
Unimplemented):RangeStream, physicalCompact(physical=true), allAuth/User/RoleRPCs, cluster membership changes (MemberAdd,MemberRemove,MemberUpdate,MemberPromote), Maintenance RPCs other thanStatusand theAlarmlist query (alarm activation and deactivation,Defragment,Hash,HashKV,Snapshot,MoveLeader), and theLockandElectionservices. - High-availability semantics: no automatic fencing or response-consistency guarantee across a PostgreSQL primary switchover. After a primary promotion, the operator updates
PGETCD_DSNand restarts the gateway. - HTTP/JSON gateway: only gRPC is served.
- Replica reads, more than 8 tenant databases per PostgreSQL instance, in-place schema upgrade migration, or performance SLAs.
Why Patroni is not supported
Patroni’s etcd3 client does not speak gRPC. It talks to the etcd HTTP/JSON gateway (/version, /v3/kv/range, /v3/kv/txn, /v3/lease/grant, /v3/watch). Because pgetcd v0.1.0 serves only gRPC, Patroni cannot use it as a DCS.
An HTTP/JSON gateway and Patroni validation are planned for MVP+1. Even then, a pgetcd instance used as a Patroni DCS must run on a separate PostgreSQL cluster; hosting a Patroni cluster’s DCS inside the same PostgreSQL cluster creates a circular dependency during failover.
RPC coverage
| RPC group | Implemented behavior | Operational limit |
|---|---|---|
Range, Put, DeleteRange, Txn | Binary keys and values, historical reads, sorting and filtering, comparisons, nested branches, read-your-own-writes inside a Txn, prev_kv, and Lease attachment | Bounded request and response sizes; one tenant per request |
Compact | Logical compaction, history anchor advancement, and boundary retention | physical=true returns Unimplemented |
LeaseGrant, LeaseKeepAlive, LeaseTimeToLive, LeaseLeases, LeaseRevoke | Logged Lease table, background worker expiration, and atomic deletion of attached keys on revoke or expiry | One public Lease RPC per PostgreSQL transaction; cannot mix Lease and KV calls in one transaction |
Watch | Multiple watches per stream, create and cancel, filters, prev_kv, RequestProgress, fragments, and reconnect | Bounded per-tenant stream and buffer quotas; a create response alone does not advance progress |
MemberList, Status | One logical tenant member, certified cluster/member identity, current revision, and PostgreSQL relation size | No Raft peer topology |
Alarm (from v0.1.0-rc2) | The list query returns an empty list under a certified header; an unready tenant returns Unavailable | Alarm activation and deactivation return Unimplemented |
Since v0.1.0-rc2 (commit 81691bc), Maintenance.Alarm answers list queries, so etcdctl endpoint health reports healthy: the etcdctl 3.6.15 and 3.7.2 probes recorded 50 PASS / 0 FAIL on 2026-11-08. On v0.1.0-rc1 the same probes recorded 48 PASS / 2 FAIL, both endpoint health.
Version baseline and advertised compatibility
The root source tree for v0.1.0-rc2 (commit 81691bc; no dependency change since v0.1.0-rc1) and the 2026-10-08 frozen P0/P1/P2 acceptance candidate use the following component versions (from versions.lock.json and the build metadata):
| Component or identifier | v0.1.0-rc2 root build | 2026-10-08 frozen candidate |
|---|---|---|
| PostgreSQL | 18.6 (REL_18_6) | 18.6 (REL_18_6) |
| Go toolchain | 1.27.3 | 1.27.1 |
etcd API / clientv3 | 3.7.2 | 3.6.15, 3.7.2 |
| Reference etcd servers | 3.6.15, 3.7.2 | 3.6.15, 3.7.2 |
| Kubernetes reference trees | 1.36.4, 1.37.1 | 1.36.4, 1.37.1 |
gRPC / protobuf / pgx | 1.84.0 / 1.36.12 / 5.11.0 | 5.11.0 (pgx) |
| Gateway product version | 0.1.0 | 0.1.0-p1 |
| Extension / SQL ABI / schema | 0.1.0 / 1 / 2 | 0.1.0 / 1 / 2 |
Advertised Status.Version | 3.6.0 | 3.6.0 |
Why Status advertises 3.6.0:
- When
RejectOldClusteris enabled,clientv3v3.6.15requires at least3.5.0andclientv3v3.7.2requires at least3.6.0(a3.5.12negative control is rejected by the 3.7 client). - Kubernetes
1.36.4and1.37.1feature_support_checkerparsesStatus.Versionto enableRequestWatchProgress, rejecting versions below3.4.31and[3.5.0, 3.5.13). - Advertising
3.6.0satisfies both checks and selects the same client code paths as3.6.15without claiming that every etcd 3.6 RPC is implemented.
Resource limits
| Resource | Bound |
|---|---|
| gRPC receive / send message size | 1,572,864 bytes (1.5 MiB) / 8 MiB |
| SQL JSONB request envelope | 2 MiB |
KV / Txn response tree | 8 MiB conservative budget (p2-kv-response-v1) |
| Ordinary Lease response / legacy Tail | 2 MiB each |
Complete _tail_v2 revision | 8 MiB; at most 4,096 events |
| Write key length | 1–2,048 bytes |
Txn nesting depth / total comparisons and operations | Depth 8 / 128 across compare, success, and failure |
| Active Leases per tenant database | 1,024 |
| Keys attached to a single Lease | At most 4,096, bounded by the complete-revoke byte budget |
| Supervised tenant databases per PostgreSQL instance | At most 8 (pg_etcd.databases) |
Admission checks reserve serialized space for both the immediate revision and any future full-Lease revocation revision. As a result, pgetcd can reject large writes or Lease attachments with ResourceExhausted even when upstream etcd would accept them. See Configuration for gateway connection and Watch buffer settings.
Deliberate differences and contract observations
- Primary-only serialized transactions: Every request runs on the PostgreSQL primary, including
Rangewithserializable=true. Both reads and writes lock the singleetcd.metarow (FOR UPDATE), write a logged publication barrier on read-only paths, and release the gRPC response only after a warning-free synchronousCOMMIT. - Deterministic tie-breaking on non-key
Rangesorts: Upstreametcd3.6.15and3.7.2use a comparator that compares only the sort target (CREATE,MOD,VERSION,VALUE) viasort.Sort, leaving equal-target ordering unspecified.pgetcdalways breaks ties by ascending key byte order (key ASC) acrossASCEND,DESCEND, andNONE. Across 186 tie-sort test vectors against the reference servers, 59 match byte-for-byte and 127 differ only in tie-group permutation (76) orlimitboundary selection within an equal-value group (51), with 0 semantic violations. Whensort_order = NONEis combined with a non-keysort_targetand a positivelimit,pgetcdpreserves upstream’s fetch-before-sort behavior (taking thelimit + 1key-ordered prefix before sorting by the target and truncating). - Revision and
Compactedge cases (verified against etcd3.6.15and3.7.2):- A fresh store starts at revision
R = 1;Compact(-1)returnsErrCompacted, the firstCompact(0)succeeds, and the first modifying write allocatesR = 2. - After
Compact(0), a top-levelRangewithrevision <= 0resolves to the current revision and succeeds, whereas aRange(-1)inside aTxnfails preflight validation withErrCompacted. - Inside a
Txn, aRangeor no-opDeleteRangeexecuted before aPutcarries the pre-write revisionRin its own child response header, while thePutand top-levelTxnheader carryR + 1. A no-opDeleteRangeby itself allocates no revision. NestedTxnresponse headers reportrevision = 0.
- A fresh store starts at revision
- Watch boundary and progress rules:
- At the compacted revision boundary
C,Watchstill deliversDELETEevents, withprev_kvomitted even whenprev_kv=truewas requested. - A watcher created with
start_revision = 0at revisionRcan legitimately receive aRequestProgressnotification atRbefore its first event atR + 1, whereas an explicit futurestart_revision > Rblocks stream-level (watch_id = -1) progress until caught up or canceled.
- At the compacted revision boundary
- Leases:
- Lease IDs and live remaining TTLs do not match another server’s clock. Requesting
TTL = 1yields a minimum grantedTTL = 2. - Granting a duplicate Lease ID returns
FailedPrecondition. CallingLeaseTimeToLiveon an unknown or expired Lease succeeds withTTL = -1. Revoking an empty Lease (no attached keys) does not increment the KV revision. - After a PostgreSQL or worker restart, every active Lease is rebuilt with its full granted TTL, so restarts can delay expiry but never cause early expiry.
- Lease IDs and live remaining TTLs do not match another server’s clock. Requesting
MemberListandStatus:MemberListreports a single logical member for the tenant.Statusreports that member ID asleaderwithraftTerm = 0.dbSizeanddbSizeInUsereport the bytes allocated by PostgreSQL relations in theetcdschema (including table and index bloat), notbboltfile sizes.
Kubernetes storage and conformance
Kubernetes compatibility has been tested at two levels on separate builds:
- Upstream
k8s.io/apiserverstorage probe onv0.1.0-rc1(commit7e43446, Linux amd64, 2026-11-08):- Kubernetes conformance is outside the MVP verification scope (MVP goal). The probe below was not repeated on
v0.1.0-rc2. - Instead,
v0.1.0-rc1ran the upstreamk8s.io/apiserverv0.36.4andv0.37.1etcd3storage probes against a live gateway: 65 PASS / 0 FAIL on each version. - On Kubernetes
1.37.1, whereEtcdRangeStreamis enabled by default in Beta, the storage client attemptsRangeStream, receivesUnimplementedwith zero chunks, callsMarkUnsupportedinfeature_support_checker, and falls back cleanly to unaryRange.
- Kubernetes conformance is outside the MVP verification scope (MVP goal). The probe below was not repeated on
- Full storage suites and selected conformance on the 2026-10-08 frozen candidate (
0.1.0-p1, extensionb0e08f12, gateway935d9fd4):- Across all upstream packages under
k8s.io/apiserver/pkg/storage/etcd3/...andk8s.io/apiserver/pkg/storage/cacher/...(including the 10,001-objectTestConsistencyCheckerDigestMatchespagination and cache catch-up test under the 8 MiBp2-kv-response-v1budget andpool_size = 32):- Kubernetes
1.36.4(commitbb826b1d, 12 packages, 243 top-level tests, 1,227 test nodes): 1,219 PASS / 0 FAIL / 8 upstream skips. - Kubernetes
1.37.1(commitf78e7223, 14 packages, 233 top-level tests, 1,209 test nodes): 1,196 PASS / 9 FAIL / 4 upstream skips. All 9 failed nodes are in tests that explicitly assert declared unsupported capabilities: 6 leaf assertions requiring nativeRangeStream(TestGetListStreamMultiChunk,TestWatchChanSync/RangeStream,TestWatchChanSyncStreamMatchesPaginated,TestWatchChanSyncStreamMetrics), 1 test callingWithCompactPhysical()(TestWatchChanSyncStreamCompactionError), and 2 parent test nodes propagating those child failures.
- Kubernetes
- On the same 2026-10-08 frozen candidate, the selected Kubernetes conformance suites passed 446 cases on
1.36.4and 462 cases on1.37.1with zero runtime skips. Those results belong to the 2026-10-08 frozen candidate and were not re-run onv0.1.0-rc1orv0.1.0-rc2.
- Across all upstream packages under
Acceptance evidence
| Suite | Build and platform | Result |
|---|---|---|
v0.1.0-rc2 official client probes | Commit 81691bc, Linux amd64, 2026-11-08 | etcdctl 3.6.15 and 3.7.2: 50 PASS / 0 FAIL, including endpoint health |
v0.1.0-rc2 concurrency test | Commit 81691bc, Linux amd64, default pool_size = 32, 2026-11-08 | 64 and 128 clients for a few minutes each: 0 refused requests, 0 readiness withdrawals; a long-lived Watch stayed connected but lagged under sustained writes |
v0.1.0-rc1 P1 mixed model audit | Commit 7e43446, Linux amd64, 2026-11-08 | 100,000 mixed KV calls, 30,011 Lease calls, 20,006 controls across 2 mTLS gateways and 5,002 windows; 0 unknown outcomes; offline replay, SQL catalog audit, and 2-stream Watch audit passed |
v0.1.0-rc1 official client probes | Commit 7e43446, Linux amd64, 2026-11-08 | etcdctl 3.6.15 and 3.7.2: 48 PASS / 2 FAIL (both endpoint health); clientv3 3.6.15 and 3.7.2 Watch suites passed |
| Frozen P1 1M-call mixed model audit | 2026-10-08 frozen candidate (0.1.0-p1) | 1,000,000 mixed calls across 16 hot keys, 4 workers, 2 gateways, and rotating Watch streams on one primary; passed independent model and Watch audit |
Status has the v0.1.0-rc2 results, performance numbers and known issues; Releases keeps the full v0.1.0-rc1 results.
