SebastianGruza opened a new pull request, #3207:
URL: https://github.com/apache/hugegraph/pull/3207
## Purpose of the PR
- close #3191
Following the `page` token with a `limit` that is a multiple of 500 returns
the last element of page *k* again as the first element of page *k+1*, one
duplicate per page boundary. It affects every query whose result is one backend
entry with more than 500 columns: the edges of one owner vertex (no condition,
sort-key prefix or range, either direction) and vertex queries by label through
the label index. RocksDB and HStore alike, because it is server code;
secondary/range/search index queries are not affected (each index key is its
own entry).
## Main Changes
`BinaryEntryIterator.fetch()` appended a record to the current entry and
only then checked whether that entry had reached `INLINE_BATCH_SIZE` (500) to
break. The next page restarts inclusively from `results.position()`, which at
that point already points at the appended record, so a page ending exactly at a
batch boundary re-emits it. The change starts a **new** entry with the record
once the current entry already holds a full batch, so `position()` never points
at a record that has been emitted. No other behaviour changes; limits that are
not a multiple of 500 take exactly the same path as before.
## Verifying these changes
- [ ] Trivial rework / code cleanup without any test coverage.
- [ ] Already covered by existing tests.
- [x] Need tests and can be verified as follows:
- `EdgeCoreTest.testQueryOutEdgesOfVertexInPagingAtBatchBoundary`: 1 200
edges of one vertex, paged with `limit` 400 / 500 / 600 / 1000; asserts the
total count and the number of distinct ids for each limit. Red on master for
500 and 1000 (1 202 and 1 201 results), green with the change.
- `EdgeCoreTest` and `VertexCoreTest` on `rocksdb` and `memory`
(`core-test` profile): all green.
- Same result set on a 3-store HStore cluster and a RocksDB oracle for the
paged shapes of issue #3191 (`n=1214 uniq=1212` before, `1212/1212` after),
measured with the black-box suite linked in the issue.
## Does this PR potentially affect the following parts?
- [ ] Dependencies
- [ ] Modify configurations
- [ ] The public API
- [x] Nope
## Documentation Status
- [x] `Doc - No Need`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]