questdb / questdb/questdb

Corrupt data is committed in WAL when DB is near kernel mmap limit

Open
#5,420 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Core
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.