Skip to content

fix: get_keys only return first 1024 items in shared dict by default#12380

Merged
nic-6443 merged 1 commit into
apache:masterfrom
nic-6443:nic/fix-get-keys
Jun 27, 2025
Merged

fix: get_keys only return first 1024 items in shared dict by default#12380
nic-6443 merged 1 commit into
apache:masterfrom
nic-6443:nic/fix-get-keys

Conversation

@nic-6443

@nic-6443 nic-6443 commented Jun 26, 2025

Copy link
Copy Markdown
Member

Description

From OpenResty Doc:

By default, only the first 1024 keys (if any) are returned. When the <max_count> argument is given the value 0, then all the keys will be returned even there is more than 1024 keys in the dictionary.

We should return complete data in the /v1/discovery/{service}/dump control API, otherwise, it will confuse users.

Which issue(s) this PR fixes:

Fixes #

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jun 26, 2025
@nic-6443 nic-6443 changed the title fix: get_keys only return first 1024 items in shared dict by default fix: get_keys only return first 1024 items in shared dict by default Jun 26, 2025
@Baoyuantop

Copy link
Copy Markdown
Contributor

I found a similar call https://github.com/apache/apisix/blob/master/apisix/init.lua#L907, do we need to handle it here?

@nic-6443

Copy link
Copy Markdown
Member Author

I found a similar call https://github.com/apache/apisix/blob/master/apisix/init.lua#L907, do we need to handle it here?

@Baoyuantop The data stored in this place is the state of each worker. I think there will not be more than 1024 workers for any apisix instance, so it does not need to be changed.

@nic-6443
nic-6443 merged commit e420fa6 into apache:master Jun 27, 2025
27 checks passed
@nic-6443
nic-6443 deleted the nic/fix-get-keys branch June 27, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants