Skip to content

Conversation

@kim
Copy link
Contributor

@kim kim commented Oct 25, 2023

Description of Changes

Previously, constructing the commit payload to append to the message log was done without holding the lock on the latter. This meant that commits could be written to the log out-of-order.

Indeed, this could be observed on deployed databases by virtue of verifying the hash chain (the parent hash is computed in generate_commit).

To fix this, the lock is now acquired immediately and held until the message is written (and potentially fsync'ed).

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

Expected complexity level and risk

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

2.5

The fix is fairly obvious, but will nevertheless require careful review due to the critical nature of the subsystem.

Previously, constructing the commit payload to append to the message log
was done without holding the lock on the latter. This meant that commits
could be written to the log out-of-order.

Indeed, this could be observed on deployed databases by virtue of
verifying the hash chain (the parent hash is computed in
`generate_commit`).

To fix this, the lock is now acquired immediately and held until the
message is written (and potentially fsync'ed).
@kim kim merged commit cb32c83 into master Oct 25, 2023
@kim kim deleted the kim/fix-wal-concurrency branch October 25, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants