-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add an RPC API that can query the list of Top N secondary index keys and their sizes #28887
Conversation
Just a thought, this proposed RPC API is really just an admin function correct? If so did you consider adding this to the IPC API instead, such that can be accessible to the node operator without adding to the public RPC API surface |
I was not even aware of the IPC API, @CriesofCarrots can you comment? I guess I can move it, my one worry though is how much work I put into enabling secondary indexes on the RPC test infrastructure in a prior PR that I made. Would I need to re-do all that work to support testing under the IPC API? If so I'd prefer to leave it here where I already have the unit test infra in place to support it. One thing I know is that this is not exposed on the RPC client interface, tho it does expose it as a new RPC API call that could be added to the RPC client later. |
Interesting, not a bad idea @mvines , but do we need an additional set of apis on AdminRpc that is only pulled in for RPC nodes? Because this is one that won't be relevant to most validators (only those running with the AccountsData set of rpc endpoints). |
This guy: https://github.com/solana-labs/solana/blob/master/validator/src/admin_rpc_service.rs Here's an example of adding to it: #22087 |
I guess the AdminRpc endpoint could be disabled when the RPC subsystem isn't active. But this way at least we don't need to worry about another RPC bug bounty when somebody finds a way to DoS node with new RPC endpoints that are really only for admin usage :) |
I don't see any notion of Secondary Indexes in this. This relies on those. Not sure if its even possible to add here without making it aware of those. |
More chatter: https://discord.com/channels/428295358100013066/439194979856809985/1046949163604131860 I'll do a little investigation tomorrow. You can probably keep moving forward on this PR, though. |
08cbfc0
to
7922384
Compare
d202e30
to
cd976af
Compare
cd976af
to
58695c5
Compare
@CriesofCarrots Will refactor to move into the Admin RPC Service after: #29003 gets merged. |
ff6f96d
to
76a1151
Compare
Admin RPC API added in separate PR to follow: #29352 |
7295a69
to
c561724
Compare
c06c7d9
to
aaa9950
Compare
@CriesofCarrots @t-nelson Good to merge? Addressed the PR comments. People are asking for the feature, if all looks good. |
@CriesofCarrots See my standup on slack for context on delays. Still need to remove the "unsafe" parts we discussed when I added my own bit packing function. Will do Sunday and ping you when its done. |
43d2fa5
to
fd5f861
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly suggestions to simplify your test harness, and note some test cases that seem to be missing. Otherwise, just nits on the prod code.
fd5f861
to
5d13e1f
Compare
914fb08
to
78fbc14
Compare
…eys and their sizes.
78fbc14
to
87322df
Compare
…ex keys and their sizes (solana-labs#28887)" This reverts commit 1e3d634.
…ex keys and their sizes (solana-labs#28887)" This reverts commit 1e3d634.
…ex keys and their sizes (#28887)" (#33121) * Revert "Add an RPC API that can query the list of Top N secondary index keys and their sizes (#28887)" This reverts commit 1e3d634. * Revert "Add Admin RPC Front End for Top N Secondary Index Key Sizes Query. (#29352)" This reverts commit aa353e4. * fix test uses * fmt
…ex keys and their sizes (#28887)" (#33121) * Revert "Add an RPC API that can query the list of Top N secondary index keys and their sizes (#28887)" This reverts commit 1e3d634. * Revert "Add Admin RPC Front End for Top N Secondary Index Key Sizes Query. (#29352)" This reverts commit aa353e4. * fix test uses * fmt (cherry picked from commit fb1ba21) # Conflicts: # validator/src/admin_rpc_service.rs
…ary index keys and their sizes (#28887)" (backport of #33121) (#33122) * Revert "Add an RPC API that can query the list of Top N secondary index keys and their sizes (#28887)" (#33121) * Revert "Add an RPC API that can query the list of Top N secondary index keys and their sizes (#28887)" This reverts commit 1e3d634. * Revert "Add Admin RPC Front End for Top N Secondary Index Key Sizes Query. (#29352)" This reverts commit aa353e4. * fix test uses * fmt (cherry picked from commit fb1ba21) # Conflicts: # validator/src/admin_rpc_service.rs * fix compile errors --------- Co-authored-by: Jeff Washington (jwash) <jeff.washington@solana.com>
Problem
Secondary account indexes can become quite large for certain keys which have many associated accounts in the system and thus require many GB of ram to store and can cause the validator to OOM. When the RPC call is made to the validator it also will just spin in a core and allocate memory and the resulting request will be too large to transmit over a single RPC request requiring many seconds and hitting connection timeouts. So often even indexing these keys is not useful at least with the current apis.
Summary of Changes
Add an RPC API that can query the list of secondary index keys and their sizes such that we can figure out which keys are taking a lot of ram and add them to the exclusion list.
Fixes #
#28666