Vault Queries using OR combinator and filter condition throw pagination errors when page limit is not exceeded
See original GitHub issueProblem
As per the defined specification, vault queries using the vault query API throw VaultQueryException
in case PageSpecification
is not defined and the number of results exceed the default page size (200). I have a query that uses OR
combinator to join two filter queries (one using a custom schema attribute) and another looking up based on StateRef
where the result of the queries is below the defined pagination limit yet the vault query API flags pagination error. If I define a pagination limit, then the error is not thrown and the result size is within the pagination limit. If I don’t use the OR
operator and perform the composition myself, the error is not thrown either.
Steps to Reproduce
The bug is reproduced here: https://github.com/bonii/corda-vault-query-pagination-bug
Run the MockNetwork test VaultQueryTests
and observe that the test which uses vault query with OR
combinator and without defining a page specification fails. Note that the other tests which use OR
combinator with page specification and composition of the individual queries without OR
combinator and page specification succeed. Also note that each of the filter queries return exactly one result and combining them using OR returns 2 results.
Note that the example might appear a bit contrived but that has been done for simplification.
It appears servicesForResolution.loadStates(stateRefs)
in NodeVaultService._queryBy
is filtering/loading the relevant stateRefs but the pagination error is thrown much before that based on an intermediate result results
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Automatically created Jira issue: CORDA-3874
Hi @nikinagy, Yes but that is a workaround for the OR combinator which I created to help in reproducibility of the bug under different cases. I don’t think you mean to say that do not use the OR combinator and the bug will not be fixed in Corda?