apple / apple/foundationdb

GetKeyValuesReply changes to support slow realization of emptiness.

Open
#3,618 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
1.6k
Avg merge
1d 20h
Merged PRs (30d)
126

Description

GetKeyValuesReply has a `more` flag which, if set, indicates there may be more results after the last KV pair, and thus it requires at least one KV pair to be in the results set.

If, however, the underlying storage engine requires a slow scan of an empty range (matching up KV pairs with recently created tombstones, for example) it may be necessary to return a partial yet empty result.

One way to facilitate this would be to change
`bool more`
to
`Optional continueKey`

to decouple the concept of a partial result from a non-empty one.

This is probably only useful for range reads which can be split across transaction boundaries.

Contributor guide

Open the contributing guide

Research direction

Start by tracing GetKeyValuesReply and the range-read paths that consume its `more` flag, especially reads split across transaction boundaries. Examine how empty ranges and recently created tombstones are represented by the underlying storage engine. Done means the API can distinguish a partial empty result from a non-empty result while preserving continuation behavior, with the affected range-read cases covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.