Repository navigation
Description
Found while auditing #887's pagination cursors. #887 fixed the cursor basis at the three operations that have one. These six have none at all: they return the whole listing, emit no Marker, and ignore a MaxRecords the caller sent.
This also corrects #887's own body, which said ElastiCache's "four [describes are] all under Marker/MaxRecords cursors". Only describeCacheClusters is.
Sites
| Operation | Site |
|---|---|
RDS DescribeDBSnapshots |
emulator/rds_plugin.go:775 |
RDS DescribeDBSubnetGroups |
emulator/rds_plugin.go:897 |
RDS DescribeDBParameterGroups |
emulator/rds_plugin.go:996 |
ElastiCache DescribeReplicationGroups |
emulator/elasticache_plugin.go:363 |
ElastiCache DescribeCacheSubnetGroups |
emulator/elasticache_plugin.go:543 |
ElastiCache DescribeCacheParameterGroups |
emulator/elasticache_plugin.go:642 |
Every one of them publishes Marker and MaxRecords on its AWS page, with the same wording the three fixed operations carry: "the response includes only records beyond the marker, up to the value specified by MaxRecords", Default: 100, Constraints: minimum 20; maximum 100.
Why it matters
Two distinct consumer failures, and the second is the reason this is a defect rather than a gap.
- A
MaxRecordsa caller sends is ignored, so a test written against substrate never exercises its own paging loop — the first page is always the whole listing. The loop is dead code that has never run, and the first time it runs is against real AWS. - A
Markera caller sends is ignored and the full listing is returned again. A consumer that pages defensively — request, take theMarker, request again while it is non-empty — terminates immediately here because noMarkercomes back, which is benign. But a consumer that passes a marker it obtained elsewhere, or that asserts a marker appears when the set exceeds a page, sees no signal at all that pagination is unimplemented rather than unnecessary.
The half-implemented state is the worst of the three possible states: implemented, absent-and-refused, or silently ignored. Substrate is in the third.
Approach
#887 put the whole contract in emulator/query_marker_pagination.go — parseQueryMarker, queryMaxRecords, queryMarkerPage — precisely so the next site is a small change. Each of these six becomes:
cursor, cursorErr := parseQueryMarker(req.Params["Marker"])
if cursorErr != nil {
return nil, cursorErr
}
prefix := "<kind>:" + scope + "/"
keys, err := p.state.List(goCtx, ns, prefix)
...
page, nextMarker := queryMarkerPage(keys, prefix, cursor, queryMaxRecords(req.Params["MaxRecords"]),
func(key, id string) (item, bool) { ... })so the six inherit the key-valued cursor, the base64 refusal of a marker substrate did not issue, and the truncate-on-next-matching-record rule, rather than each re-deriving them.
Two things to settle per operation while doing it, since they are not uniform:
- The identifier the marker names. For a snapshot it is the snapshot identifier; for a subnet or parameter group, the group name. It must be the value the listing is keyed and sorted by, or the cursor is not well defined — which is the same trap Audit the remaining ~60 List call sites for an AWS-documented order that differs from lexicographic #887 fixed.
- Whether the
NotFoundfault still fires.describeDBInstancescheckslen(page) == 0against a filter identifier after paging. Any of these six with a single-resource filter parameter needs the same ordering, or a filtered request landing on page two would answerNotFoundfor a record that exists.
Acceptance criteria
- All six honour
MarkerandMaxRecordsthroughquery_marker_pagination.go's helpers, so the cursor semantics cannot diverge from the three operations Audit the remaining ~60 List call sites for an AWS-documented order that differs from lexicographic #887 fixed. - A
Markersubstrate did not issue is refused, with the provenance recorded as Audit the remaining ~60 List call sites for an AWS-documented order that differs from lexicographic #887 did:InvalidParameterValue/ 400 is published for ElastiCache (API_DescribeReplicationGroups,API_DescribeCacheSubnetGroups) and is substrate's reading for the three RDS operations, whose pages publish only their NotFound faults. - A full last page carries no
Marker. - At each of the six, a wire-level test pages a listing smaller than the page size (one page, no
Marker) and one larger (every record reported exactly once across the pages, none repeated). - Where an operation has a single-resource filter parameter, a test asserts a filtered request that would land past page one still answers the record rather than
NotFound. -
docs/services.mdrecords that these six became paginated, and theMarkerrefusal code's provenance per family. - RDS and ElastiCache honour a MaxRecords outside the documented 20-100 range and silently rewrite an unusable one #913's
MaxRecordsrange decision is applied to these six too, or, if RDS and ElastiCache honour a MaxRecords outside the documented 20-100 range and silently rewrite an unusable one #913 has not landed, this issue notes that they inheritqueryMaxRecords' current permissiveness so the two do not disagree.
Found while working on #887.
Activity
scttfrdmn commentedon Sep 17, 2026
Two corrections to this issue's own body before the work starts, both verified from the six pages rather
than from the issue text, and one note on what #913 changed for the last criterion.
1. The
InvalidParameterValueprovenance in AC 2 is wrong for one of the two pages it namesAC 2 says the code is published for ElastiCache, citing
API_DescribeReplicationGroupsandAPI_DescribeCacheSubnetGroups. The second is not true.API_DescribeCacheSubnetGroups' Errorssection, read in full, publishes exactly one fault:
No
InvalidParameterValue, and noInvalidParameterCombination. The split across the six is thereforetwo published, four substrate's reading, not "ElastiCache published, RDS unverified":
InvalidParameterValueDescribeReplicationGroupsInvalidParameterCombination/400,InvalidParameterValue/400,ReplicationGroupNotFoundFault/404DescribeCacheParameterGroupsCacheParameterGroupNotFound/404,InvalidParameterCombination/400,InvalidParameterValue/400DescribeCacheSubnetGroupsCacheSubnetGroupNotFoundFault/400 onlyDescribeDBSnapshotsDBSnapshotNotFound/404 onlyDescribeDBSubnetGroupsDBSubnetGroupNotFoundFault/404 onlyDescribeDBParameterGroupsDBParameterGroupNotFound/404 onlyThe conclusion does not change — one code still serves all six, so the cursor cannot be refused
differently at different operations — but the provenance line in
docs/services.mdhas to say fourof the six are substrate's reading, and it cannot lean on the family boundary to decide which.
2. The
MaxRecordsconstraint wording is not identical across the sixThe body quotes
Constraints: minimum 20; maximum 100for all six. The three RDS pages publish it withdifferent capitalisation and punctuation —
Constraints: Minimum 20, maximum 100.— and the threeElastiCache pages publish
Constraints: minimum 20; maximum 100.The numbers and theDefault: 100areidentical everywhere, which is what matters, but a doc comment quoting one form for all six would be
misquoting three pages.
Also verified: all six publish a
Markerrequest parameter with no Length Constraints and noPattern, and all six publish a
Markerresponse element. The two families word the response elementdifferently — RDS repeats the request description, ElastiCache says only "Provides an identifier to allow
retrieval of paginated results." — which is another statement of the same contract, not a different one.
3. AC 7 is discharged by #913, and the approach snippet is now stale
#913 has landed, so
queryMaxRecordsno longer coerces: it refuses aMaxRecordsoutside 20–100, and anon-integer, with
InvalidParameterValue/400. These six therefore inherit the range check, not thepermissiveness AC 7 hedges against, and the two issues cannot disagree.
That changes the signature the approach section shows. It is no longer
because
queryMaxRecordsnow returns(int, *AWSError). Each of the six validates both parameterstogether, above the state read, as the three fixed operations now do:
One consequence for AC 4's tests: a listing "larger than the page size" now means more than twenty
records, because twenty is the smallest page AWS accepts. #913 recorded eleven existing request sites
that paged at
MaxRecords=2for exactly this reason; the new tests here must not add a twelfth.4. Single-resource filter parameters, for AC 5
Every one of the six has one, so AC 5 applies at all six rather than at some:
DBSnapshotIdentifier,DBSubnetGroupName,DBParameterGroupName,ReplicationGroupId,CacheSubnetGroupName,CacheParameterGroupName.DescribeDBSnapshotsadditionally publishesDBInstanceIdentifier,DbiResourceId,SnapshotType,IncludePublic,IncludeSharedandFilters.Filter.N(valid namesdb-instance-id,db-snapshot-id,dbi-resource-id,snapshot-type,engine) — so it is the one ofthe six where "filter, then page" has more than one filter to order against, and the ordering trap this
issue names for the
NotFoundfault is correspondingly easier to get wrong there.Both RDS group describes publish
Filters.Filter.Nas "Not currently supported", which is worthrecording: it is a parameter AWS declares and refuses to honour, so substrate ignoring it matches the
page rather than diverging from it.
fix(rds,elasticache): six describes published a cursor and implemente…