tursodatabase / tursodatabase/libsql

Use a virtual WAL conneciton when checkpointing before bottomless

Open
#841 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Following this FIXME:
https://github.com/tursodatabase/libsql/blob/0595417845ba73b0fc6e93839e6f301d61b9dfbb/libsql-server/src/replication/primary/logger.rs#L714-L716

Right now, our code uses a regular WAL connection for checkpointing the db file before initializing bottomless replication. We should never use non-virtual-WAL connections in our code, so it's a bug. It also needs a careful fix, because we need to keep the initialization order correct, and the issue is that this checkpointing code needs to run before bottomless replication is initialized, and our virtual WAL is only created after bottomless replication is initialized, so we need to break a dependency cycle.

Discussed in #834

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 with the FIXME in libsql-server/src/replication/primary/logger.rs at lines 714-716, then review the initialization-order discussion in issue #834. The change is done when checkpointing before bottomless replication uses a virtual-WAL connection without breaking bottomless replication initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sqlite
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.