Skip to content

Conversation

Vegetable26
Copy link

@Vegetable26 Vegetable26 commented Jan 24, 2025

I was performing some storage fault injection tests - where storage IO for one database repeatedly error.

I was running into a case - where I was injecting a failure on optimistic write fsync at https://github.com/motherduckdb/duckdb/blob/dad112b203212a590cb764695abf911e93d6ceee/src/transaction/duck_transaction.cpp#L207

The problem is if we see a storage error on WAL truncate at the following - the program will terminate due to throwing an exception in a try/catch.
https://github.com/motherduckdb/duckdb/blob/dad112b203212a590cb764695abf911e93d6ceee/src/transaction/duck_transaction.cpp#L211

I was curious on your thoughts on if the logic was refactored a bit to perform the rollback outside of the original try/catch.

Some questions:

  • Is it ok to propagate the first exception if rollback fails?
  • Will the db be invalidated if a RevertCommit fails?

@Vegetable26 Vegetable26 changed the title [bug-fix] Avoid throwing in catch block [bug-fix] Avoid throwing in catch block for failed commits Jan 24, 2025
@szarnyasg szarnyasg requested a review from Mytherin February 10, 2025 13:08
@Mytherin Mytherin changed the base branch from main to v1.2-histrionicus February 10, 2025 13:21
@Mytherin Mytherin merged commit 4f80644 into duckdb:v1.2-histrionicus Feb 10, 2025
47 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Mar 7, 2025
[bug-fix] Avoid throwing in catch block for failed commits (duckdb/duckdb#15903)
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.

2 participants