Skip to content

go: store/datas/database_common: store/nbs/store.go: Fix some issues when pushing to a dolt sql-server that is itself running GC.#9329

Merged
reltuk merged 5 commits intomainfrom
aaron/push-to-sql-server-during-gc-fixes
Jun 11, 2025
Merged

go: store/datas/database_common: store/nbs/store.go: Fix some issues when pushing to a dolt sql-server that is itself running GC.#9329
reltuk merged 5 commits intomainfrom
aaron/push-to-sql-server-during-gc-fixes

Conversation

@reltuk
Copy link
Contributor

@reltuk reltuk commented Jun 10, 2025

A push to a remote works by uploading the missing content and then adding references to it in the remote datastore. If the remote is running a GC during the push, it is possible for the newly added data to be collected and no longer be available when the references are added.

This should cause a transient failure which is safe is retry. There were a couple bugs which could instead cause a panic. This makes some changes to safeguard against those case.

…when pushing to a dolt sql-server that is itself running GC.

A push to a remote works by uploading the missing content and then adding
references to it in the remote datastore. If the remote is running a GC during
the push, it is possible for the newly added data to be collected and no longer
be available when the references are added.

This should cause a transient failure which is safe is retry. There were a
couple bugs which could instead cause a panic. This makes some changes to
safeguard against those case.
@coffeegoddd
Copy link
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
956f073 ok 5937457
version total_tests
956f073 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
5701a93 ok 5937457
version total_tests
5701a93 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Contributor

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
07a2e11 ok 5937457
version total_tests
07a2e11 5937457
correctness_percentage
100.0

@macneale4 macneale4 self-requested a review June 10, 2025 21:19
Copy link
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The panics make me a little nervous. Seems a little over the top. Is the ref counting critical enough that you want to hear from a user when this happens?

if cnt == 0 {
return fra.f.Close()
} else if cnt < 0 {
panic("invalid cnt on fileReaderAt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why panic? Yeah, it's a bug, but is it worth bringing down the server? Could we just put an error in the logs and move on?

Copy link
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@reltuk reltuk merged commit 6b13f00 into main Jun 11, 2025
21 checks passed
@coffeegoddd
Copy link
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
2d00d71 ok 5937457
version total_tests
2d00d71 5937457
correctness_percentage
100.0

@Hydrocharged Hydrocharged deleted the aaron/push-to-sql-server-during-gc-fixes branch December 15, 2025 06:41
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.

3 participants