h2database / h2database/h2database

SERIALIZABLE transactions need to mark selected rows

Open
#2,167 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.6k
Forks
1.3k
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Current implementation of SERIALIZABLE isolation level in MVStore should be valid for read-only transactions, but concurrent transactions with changes aren't guaranteed to have the same effect as their execution in order.

(Note that in all released versions of H2 this isolation level effectively works as READ COMMITTED, so it's not a regression for MVStore engine.)

  1. SERIALIZABLE transaction should fail when it tries to update a row that was modified by another transaction. Such restriction should be simple to implement, we have a complete snapshot and can compare values.

  2. SERIALIZABLE transaction with changes should not be able to commit its work if rows that were selected by this transaction were modified by another transaction. That's not that simple, perhaps such transaction should collect all accessed rows somewhere. As an alternative we may lock them all, but it will be very expensive and it will reduce scalability. Another serializable transaction may read the same rows, and if they weren't modified anywhere they may continue its work concurrently.

After either failure transaction can only be rolled back.

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.

Research direction

Start by tracing MVStore's SERIALIZABLE transaction implementation, including its complete snapshot and row-selection handling. Done means conflicting updates or selected-row modifications cause the transaction to fail and require rollback, while read-only transactions remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.