Skip to content

fix(rds,elasticache): six describes published a cursor and implemented none of it (#916) - #1021

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/paginate-six-describes-916
Sep 17, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/paginate-six-describes-916

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #916.

Six describes publish Marker and MaxRecords and honoured neither. Each answered its entire
listing, emitted no Marker, and discarded the page size the caller asked for:

  • RDS DescribeDBSnapshots, DescribeDBSubnetGroups, DescribeDBParameterGroups
  • ElastiCache DescribeReplicationGroups, DescribeCacheSubnetGroups, DescribeCacheParameterGroups

Of the three states a published parameter can be in — implemented, absent and refused, or accepted
and ignored — this is the worst, and it is the one all six were in. A consumer's paging loop
terminates on the first response here, so the loop is dead code whose first real execution is
against AWS over a listing long enough to page; and with nothing decoding the parameter, a Marker
persisted across a restart or copied from another operation was answered with the whole listing
again rather than refused.

All six now page through the same three helpers as the three operations #887 fixed —
parseQueryMarker, queryMaxRecords and queryMarkerPage — so nine operations share one
cursor
and cannot diverge on its semantics by construction rather than by nine sites agreeing.
A Marker substrate did not issue is refused, a full last page carries no Marker, #913's 20–100
range applies here too, and both parameters are validated before any state is read.

Provenance — and a correction to #916's own acceptance criteria

AC 2 said the refusal code is published for ElastiCache and is substrate's reading for RDS,
naming API_DescribeReplicationGroups and API_DescribeCacheSubnetGroups. The second half is
false, and the family boundary is not the rule. Read from the pages:

Page InvalidParameterValue / 400 Published errors
API_DescribeCacheClusters published cluster faults, plus InvalidParameterValue and InvalidParameterCombination
API_DescribeReplicationGroups published ReplicationGroupNotFoundFault/404, InvalidParameterValue/400, InvalidParameterCombination/400
API_DescribeCacheParameterGroups published CacheParameterGroupNotFound/404, InvalidParameterValue/400, InvalidParameterCombination/400
API_DescribeCacheSubnetGroups absent CacheSubnetGroupNotFoundFault/400 only
API_DescribeDBInstances absent DBInstanceNotFound/404 only
API_DescribeDBClusters absent its own NotFound fault only
API_DescribeDBSnapshots absent DBSnapshotNotFound/404 only
API_DescribeDBSubnetGroups absent DBSubnetGroupNotFoundFault/404 only
API_DescribeDBParameterGroups absent DBParameterGroupNotFound/404 only

Three of nine published, six substrate's reading, and API_DescribeCacheSubnetGroups is why
it has to be stated per page: it is an ElastiCache page that does not publish the code. Recorded in
docs/services.md, in both helpers' doc comments, and in the CHANGELOG. This was
commented on the issue
before the work started rather than being reversed silently in a diff.

The MaxRecords range is published identically on all nine, though not in identical words: the RDS
pages write Constraints: Minimum 20, maximum 100. and the ElastiCache pages
Constraints: minimum 20; maximum 100. The numbers are what one shared range depends on.

The filter-plus-page ordering trap is closed by construction, and asserted anyway

Every one of the six publishes a single-resource filter parameter. A filter applied after a page
is cut would answer an empty page — or a NotFound fault — for a record that exists and merely sorts
late. It cannot happen here: the filter runs inside queryMarkerPage's record callback and a
non-matching record consumes no page slot, so a filtered listing is one record long however deep
into the unfiltered listing the record sits. DescribeReplicationGroups is the one of the six that
answers a NotFound fault today, and its fault is therefore decided on a page that cannot be empty
for a group that exists. A test filters for a record sorting past position twenty at all six, so a
later refactor that hoists a filter out of the callback fails rather than quietly starts answering
NotFound for records that exist.

Tests

emulator/query_marker_six_describes_test.go drives all six over the wire through their own create
calls, using one depth-based XML decoder rather than six near-identical structs. All six
responses nest as Response > Result > Wrapper > Item > Identifier, so an identifier is at depth
five and the result's own Marker at depth three; matching on the element name alone would be a
weaker assertion than the structs it replaces, since a record rendered into the wrong wrapper would
still be picked up.

Per operation: a listing inside one page (no Marker), a listing of 21 paged at 20 (every record
exactly once, the Marker pinned to the last record of the page rather than an offset), a 40-record
listing whose full last page carries no Marker, an unissued Marker refused against an empty
listing so it is a parameter check rather than a data-dependent one, #913's MaxRecords refusal
cases, and the filter-past-page-one case. Plus a table-driven guard that a NotFound fault still
fires for a resource that does not exist over a listing long enough to page — which covers
DescribeReplicationGroups today and picks up the other five as #1020 gives them one, rather than
needing a test written per operation.

No test in the new file pages at MaxRecords=2, the page size #913 recorded eleven pre-existing
sites for: the small cases fit inside the documented minimum of twenty and the paging cases create
21, 25 or 40 records.

Out of scope, on the record

Five of the six publish a NotFound fault their handler does not answer — a filtered request naming a
resource that does not exist gets an empty 200 instead of DBSnapshotNotFound/404,
DBSubnetGroupNotFoundFault/404, DBParameterGroupNotFound/404,
CacheSubnetGroupNotFoundFault/400 or CacheParameterGroupNotFound/404. That is a defect about
a request's result rather than about how a listing is cut into pages, and it is filed as #1020 for
the reason #887 kept MaxRecords out of its own diff.

docs/services.md's hand-written ElastiCache operation table was also missing eight implemented
operations, including both group describes this change paginates; the rows are added in the same
pass.

Verification

The nine-command gate, all green, with coverage held at or above the 84.9% emulator / 84.4% total
baseline.

…d none of it (#916)

RDS DescribeDBSnapshots, DescribeDBSubnetGroups and DescribeDBParameterGroups, and
ElastiCache DescribeReplicationGroups, DescribeCacheSubnetGroups and
DescribeCacheParameterGroups each publish Marker and MaxRecords and honoured neither:
every request answered the whole listing, emitted no Marker, and discarded the page size
the caller asked for. Of the three states a published parameter can be in — implemented,
absent and refused, or accepted and ignored — that is the worst, because a consumer's
paging loop terminates on the first response here and so first executes against real AWS,
and a Marker from anywhere else restarted the listing instead of being refused.

All six now page through parseQueryMarker, queryMaxRecords and queryMarkerPage, so nine
operations share one cursor and cannot diverge on its semantics. Both parameters are
validated before any state is read.

The refusal code is published for three of the nine and is substrate's reading for six,
and the split is not the family boundary — which reverses this issue's own acceptance
criteria, corrected on the record before the work. API_DescribeCacheSubnetGroups is
ElastiCache and publishes CacheSubnetGroupNotFoundFault/400 alone, so each page's status
is now stated individually rather than by family.

The filter-plus-page ordering trap is closed by construction: the filter runs inside
queryMarkerPage's record callback and a non-matching record consumes no page slot, so a
single-resource filter always lands on page one however late its record sorts. A test
asserts it at all six anyway, so a refactor that hoists a filter out of the callback fails
rather than starts answering NotFound for records that exist.

The six are asserted through one depth-based XML decoder rather than six near-identical
structs, and no new test pages at MaxRecords=2 — the page size #913 recorded eleven
pre-existing sites for.

Five of the six publish a NotFound fault their handler does not answer; that is #1020.
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.15686% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
emulator/elasticache_plugin.go 92.10% 6 Missing ⚠️
emulator/rds_plugin.go 92.20% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 8d36829 into main Sep 17, 2026
17 checks passed
@scttfrdmn
scttfrdmn deleted the feat/paginate-six-describes-916 branch September 17, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Six RDS/ElastiCache describes publish Marker and MaxRecords and implement neither

1 participant