Corrupt data is committed in WAL when DB is near kernel mmap limit
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.3k
- Forks
- 1.6k
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 28
Description
To reproduce
When DB experiences errno=12 because it's near mmap kernel limit it can start writing corrupt data in WAL. That then crash the database and suspends the tables.
The database should instead fail to commit the data.
2025-02-25T11:11:42.427397Z C server-main unhandled error [job=io.questdb.network.IODispatcherLinux@793138bd, ex=
io.questdb.cairo.CairoException: [12] could not mmap column [fd=472922493926, size=1048576]
]
can result in _event.i files being 0 sizes on the disk. This then can either crash the DB or suspend WAL table.
QuestDB version:
8.1.2
OS, in case of Docker specify Docker and the Host OS:
Docker, Linux
File System, in case of Docker specify Host File System:
ext4
Full Name:
Alex Pelagenko
Affiliation:
QuestDB
Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?
- Yes, I have
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the errno=12 condition on Linux near the kernel mmap limit with a WAL table, then trace the commit path that produces zero-size _event.i files. Done means the commit fails without corrupting WAL data, and the database or table does not crash or become suspended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100