apple / apple/foundationdb

RYW transactions don't handle append_if_fits correctly

Open
#13,828 2 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

```
$ cat test.py && echo "===" && python3 test.py
import fdb

fdb.api_version(730)
db = fdb.open()

class Cancel(Exception):
pass

@fdb.transactional
def do_setup(tr):
tr[b""] = b"a" * 70000

do_setup(db)

@fdb.transactional
def do_test(tr, write_first):
if write_first:
do_setup(tr)
tr.append_if_fits(b"", b"b" * 20000)
tr.append_if_fits(b"", b"b" * 20000)
print(len(tr[b""]))
raise Cancel()

try:
do_test(db, False)
except Cancel:
pass

try:
do_test(db, True)
except Cancel:
pass
===
70000
90000
```

Contributor guide

Open the contributing guide

Research direction

Start by running the reproduction in test.py and compare the two do_test paths, with and without write_first. Trace the transaction handling behind append_if_fits for read-your-writes behavior; done means both cases handle the append consistently and have regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.