New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit query param works incorrectly for _all_dbs
#3786
Comments
@nickva bisected commit history and located the commit where this fault was introduced. Further analysis revealed that by changing the code to use the actual shards db, it caused custodian's design doc to be injected into that db:
Evidently
I haven't looked at the code yet, but perhaps the limit could be applied after the ddoc has been filtered out? |
An alternative could be to move to not use a VDU and instead rely on a before_doc_update/3 validation function since this is a system DB. We did a similar thing for _replicator auto-injected VDU in Additionally, the VDU / validation probably shouldn't happen in custodian but rather in the mem3 module, so we should move the logic there if we plan on keeping it for the future. |
Using a
Is this to what you are referring? Also agree that |
Yeah that's the before_doc_update/3 handler I was referring to. That callback works, I believe, on system databases in a fairly straightforward manner and if we translate the doc body to a map before passing it to the validator, we can do succinct pattern matching that might look more elegant than the JS version. |
Tentative (draft) PR #3796 |
This fixes issue: #3786 In addition, add few _all_dbs limit tests since we didn't seem to have any previously to catch such issues. Plus, test some of the corner cases which should be caught by the BDU and should return a 403 error code.
This fixes issue: #3786 In addition, add few _all_dbs limit tests since we didn't seem to have any previously to catch such issues. Plus, test some of the corner cases which should be caught by the BDU and should return a 403 error code.
This fixes issue: #3786 In addition, add few _all_dbs limit tests since we didn't seem to have any previously to catch such issues. Plus, test some of the corner cases which should be caught by the BDU and should return a 403 error code.
This is fixed and should be ready for 3.2.1 |
Description
all_dbs
withlimit
query is not working well. The response always has an array with alimit-1
length.Steps to Reproduce
Expected Behaviour
Get back as many elements in the array as the
limit
tells.Your Environment
Additional Context
The text was updated successfully, but these errors were encountered: