Skip to content

fix: Prevent the DynamoDB store from failing when flags or segments exceed 1 MB - #464

Merged
jsonbailey merged 1 commit into
mainfrom
jb/sdk-3284/dynamodb-query-pagination
Oct 9, 2026
Merged

jsonbailey merged 1 commit into
mainfrom
jb/sdk-3284/dynamodb-query-pagination

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The DynamoDB feature store raised NoMethodError: undefined method 'exclusive_start_key=' for an instance of Hash when a Query for one kind needed a second page. DynamoDB returns at most 1 MB per page, so this happened once all flags or all segments together exceeded about 1 MB. init failed on every stream connect, so the persistent store never updated. The bug has been present since the DynamoDB store was added in 5.5.0.

  • Set the start key on the request Hash in both paging loops (get_all_internal and read_existing_keys).
  • Fix the same mistake in the spec helper that clears the table.
  • Add tests against DynamoDB Local. A client handler sets a small Query limit, so the real server pages a small data set. The tests check that more than one page is read in all and in init.

Verified against aws-sdk-dynamodb 1.174.0, and 1.57.0 (the gemspec floor) with aws-sdk-core 3.109.0 (its floor).

Closes #462


Note

Overview
Fixes DynamoDB feature store pagination when a Query returns more than one page (~1 MB of flags/segments). Paging loops now set req[:exclusive_start_key] on the request Hash instead of calling exclusive_start_key=, which raised NoMethodError and broke all and init on the second page.

The spec table-clear scan loop uses the same Hash-key fix. New DynamoDB Local tests inject a small Query limit so multi-page reads are exercised for all and for init (including deletion of keys dropped from the new payload).

Reviewed by Cursor Bugbot for commit b2b0d6f. Bugbot is set up for automated code reviews on this repo. Configure here.

@jsonbailey
jsonbailey marked this pull request as ready for review October 9, 2026 16:07
@jsonbailey
jsonbailey requested a review from a team as a code owner October 9, 2026 16:07
@jsonbailey
jsonbailey merged commit 3777ee1 into main Oct 9, 2026
12 checks passed
@jsonbailey
jsonbailey deleted the jb/sdk-3284/dynamodb-query-pagination branch October 9, 2026 16:37
jsonbailey pushed a commit that referenced this pull request Oct 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.18.3](8.18.2...8.18.3)
(2026-10-09)


### Bug Fixes

* Prevent the DynamoDB store from failing when flags or segments exceed
1 MB
([#464](#464))
([3777ee1](3777ee1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release 8.18.3** — bumps the SDK from `8.18.2` to `8.18.3` across
the release manifest, `LaunchDarkly::VERSION`, and the provenance
verification example in `PROVENANCE.md`.
> 
> `CHANGELOG.md` documents the shipped fix: the DynamoDB persistent
feature store no longer fails when individual flags or segments exceed
DynamoDB’s 1 MB item limit
([#464](#464)).
This PR is Release Please metadata only; the implementation landed in an
earlier commit.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9977ae3. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

DynamoDB feature store crashes with NoMethodError: exclusive_start_key= when a kind exceeds 1 MB

3 participants