Skip to content

Conversation

@gefjon
Copy link
Contributor

@gefjon gefjon commented Dec 16, 2025

Description of Changes

Based on #3887 . Review starting from commit 233b48c.

We've encountered a commitlog which includes inserts into st_table, st_column, &c of the rows which describe st_view, st_view_param, &c. This caused replay to fail, as those rows were already inserted during bootstrapping,
so we got set-semantic duplicate errors. With this commit, we ignore set-semantic duplicate errors when replaying a commitlog specifically for rows in system tables which describe system tables.

We also have to do an additional fixup for sequences. This is described in-depth in comments added at the relevant locations.

API and ABI breaking changes

N/a

Expected complexity level and risk

1 - I was careful not to swallow any errors which aren't obviously safe.

Testing

  • Manually replayed commitlog which includes the above mentioned inserts, got error prior to this commit, no error with this commit.

@gefjon
Copy link
Contributor Author

gefjon commented Dec 16, 2025

This PR appears to not (yet) have fully fixed the issue: I get a unique constraint violation after replay on st_sequence_sequence_id for [U32(7), String("st_view_arg_id_seq"), U32(16), U16(0), I128(Packed(1)), I128(Packed(4097)), I128(Packed(1)), I128(Packed(170141183460469231731687303715884105727)), I128(Packed(4097))].

We've encountered a commitlog which includes inserts into `st_table`, `st_column`, &c
of the rows which describe `st_view`, `st_view_param`, &c.
This caused replay to fail, as those rows were already inserted during bootstrapping,
so we got set-semantic duplicate errors.
With this commit, we ignore set-semantic duplicate errors when replaying a commitlog
specifically for rows in system tables which describe system tables.
Use `Cow<'_, str>` and `Cow<'_, [u8]>` rather than `&str` and `&[u8]`
when deserializing parts of `st_table` and `st_column` which are encoded as strings and bytes,
as the only-borrowed deserializers error when passed a `ValueDeserializer`,
due to the inability to borrow.
@gefjon gefjon force-pushed the phoebe/ignore-st-meta-inserts branch from 3539a19 to 139dc8b Compare December 17, 2025 15:39
@gefjon gefjon changed the base branch from phoebe/fault-tolerant-replay-for-debugging to master December 17, 2025 15:39
@gefjon
Copy link
Contributor Author

gefjon commented Dec 17, 2025

Rebased onto master, as the previous base branch has merged in #3887 .

gefjon and others added 3 commits December 17, 2025 10:47
…tance (#3892)

# Description of Changes

Based on #3891 . Begin reviewing from commit 4370b69.

Prior to this commit, we treated it as an error (in fact a panic, prior
to an earlier commit of mine today) when deleting a table during replay
which didn't have an in-memory instace. This should not have been an
error, as it's not problematic, and it can occur in valid commitlogs
when a table is initially empty and is never used prior to its deletion.

With this commit, don't error.

# API and ABI breaking changes

N/a

# Expected complexity level and risk

1

# Testing

- [x] Manually replayed a database with such a deleted table. Got an
error prior to this commit, succeeded replay with this commit.
@gefjon gefjon added this pull request to the merge queue Dec 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2025
@gefjon gefjon added this pull request to the merge queue Dec 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2025
@gefjon gefjon added this pull request to the merge queue Dec 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2025
@gefjon gefjon added this pull request to the merge queue Dec 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2025
@jdetter jdetter added this pull request to the merge queue Dec 17, 2025
Merged via the queue into master with commit 4829616 Dec 17, 2025
29 checks passed
@jdetter
Copy link
Collaborator

jdetter commented Dec 17, 2025

I did nothing differently here to get it to merge 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants