FATAL Error: Database invalidated. Failed to create checkpoint as .wal file does not exist

Open
#331 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, linux, sql
Domain
backend, databases

Research direction

Start by reproducing the concurrent select and update/INSERT scenario using DuckDBConnection.duplicate with jdbc_stream_results enabled, focusing on the checkpoint failure involving duckdb.db.wal. Inspect the Java JDBC connection behavior around duplicate connections and determine whether the database remains valid during concurrent access without a missing-WAL-file error.

Written by the indexing model from the issue text.

Description

Java 21, Duckdb 1.2.2.0, OS: Linux Redhat 10

In my Java application, I am opening multiple connections from different threads to Duckdb in persistent mode. In the start of the application, I create a main connection, and now any subsequent connection is created using DuckDBConnection.duplicate.
DuckDB file is only accessed from this process.

My connection is created with property jdbc_stream_results set to true.

One of my update query failed with error:

java.sql.SQLException: FATAL Error: Failed: database has been invalidated because of a previous fatal error. The database must be restarted prior to being used again.
Original error: "Failed to create checkpoint because of error: Could not remove file "/home/ec2-user/duckdb/./duckdb.db.wal": No such file or directory"

Scenario:

  1. DuckDb is being queried by a select query on a different table parallely.
  2. Update/INSERT queries are coming. They are processed in different threads. To run a query, I create new connection (using duplicate) and run the query.

My duckdb.db file is around 160 GB.

Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 41m
Merged PRs (30d)
44

Contributor guide

No contributing guide indexed for this repository

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.

More from duckdb/duckdb-java

All issues in duckdb/duckdb-java

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.