Commit Graph

28989 Commits

Author SHA1 Message Date
Aaron Son ffef6e92d7 go/store/nbs: Fix possible data loss from Dolt CLI utilization when executing against a running server that was in the process of writing to its journal file.
Since Dolt v1.78.5, Dolt has truncated the journal file to the latest successfully loaded record when it successfully loads a database. This is the correct behavior when the CLI is operating as the exclusive writer to the database. However, Dolt also has a mode where it can load the database in read-only mode. Due to a bug, Dolt was also truncating the journal file when it was operating in this mode. The end result was the running something like `dolt sql -r csv -q ...` against a Dolt database that was running a sql-server and was currently accepting writes could incorrectly truncate the journal file. The Dolt sql-server process would go ahead writing into the journal at its previously extended offset and the space between the truncation and the next write offset would be 0 filled by the operating system. Attempting to load the database later or accessing the chunks located at that corrupted portion of the journal file would result in checksum errors or failure to load messages.

This change correctly updates Dolt to only Truncate the journal file when we are loading it in read-write mode.
2026-01-20 14:46:25 -08:00
Aaron Son 383b107d79 Merge pull request #10319 from dolthub/aaron/oldgen-sync-manifest-writes
go/store/nbs: file_manifest.go: Always make manifest writes crash safe. Remove optional async manifest write support.
2026-01-20 19:03:45 +01:00
Aaron Son 14ac7f4b49 Merge remote-tracking branch 'origin/main' into aaron/oldgen-sync-manifest-writes 2026-01-16 16:17:04 -08:00
Aaron Son 00f46cbc0c Merge pull request #10327 from dolthub/aaron/lazy-temp-file-provider
go/cmd/dolt: Make movable temp file configuration lazy.
2026-01-17 01:16:29 +01:00
Aaron Son 0d0176025d Update go/store/util/tempfiles/temp_files.go
Co-authored-by: angelamayxie <angela@dolthub.com>
2026-01-16 15:42:32 -08:00
Aaron Son 5362a4ca25 go/store/utils/tempfiles: PR feedback. Comment for LazyTempFileProvider. 2026-01-16 15:42:10 -08:00
Aaron Son 0138923e6a go/cmd/dolt: Make movable temp file configuration lazy.
Previously, early in the process life-cycle after dolt was run, dolt would immediately check if a file created in `os.TempDir()` was able to be `os.Rename`d into a subdirectory of the dolt process's data directory, by default `$PWD/.dolt`. If the rename failed, it would configure Dolt to use `.dolt/temptf` as the movable temp file directory instead.

This meant that for many `dolt` invocations, Dolt would do some local filesystem writes, including potentially `Mkdir(.dolt)` before it it was fully loaded. With the advent of things like dolt accessing the running server through sql-server.info and `dolt --host ... sql` this behavior was not ideal. It creates races with concurrently run `dolt` processes that try to use the `.dolt` directory, and it creates odd behavior when running something like `dolt sql` in a non-Dolt directory but on a filesystem mount where this rename from `os.TempDir()` does not work.

This PR changes the check and the configuration of a potential `.dolt/temptf` directory to be delayed until the first temporary movable file is actually requested by Dolt. At that point we know that we have a need for a renamable temp file and it is OK to go ahead and create `.dolt/temptf` if we need it.

This PR changes the error handling around some edge cases like permissions errors on the calling process creating `temptf` within `.dolt`. In particular, some errors which were previously early and fatal are now delayed until use site and may end up being persistent but non-fatal to the process, depending on the operation.
2026-01-16 15:13:12 -08:00
angelamayxie 3b69c9598b Merge pull request #10321 from dolthub/nicktobey-eeb3f7f5
[auto-bump] [no-release-notes] dependency by nicktobey
2026-01-16 11:40:58 -08:00
angelamayxie 5ea58598aa Merge branch 'main' of https://github.com/dolthub/dolt into nicktobey-eeb3f7f5 2026-01-16 10:59:04 -08:00
angelamayxie a4007bf5f6 Merge pull request #10320 from dolthub/elian/dckrerr
[no-release-notes] Allow disk metrics to check virtual file systems
2026-01-16 10:58:43 -08:00
angelamayxie 18eed5655f fix LICENSES 2026-01-16 10:23:00 -08:00
angelamayxie 11fc1ce304 Merge branch 'main' of https://github.com/dolthub/dolt into elian/dckrerr 2026-01-16 10:21:40 -08:00
angelamayxie 3bfc6e8ed1 Merge branch 'main' of https://github.com/dolthub/dolt into nicktobey-eeb3f7f5 2026-01-15 17:04:58 -08:00
angelamayxie d522127793 Merge pull request #10322 from dolthub/aaron/update-ci-check-repo
.github/workflows/ci-check-repo.yaml: Make the action step which updates Godeps/LICENSES look more like update.sh.
2026-01-15 17:00:19 -08:00
angelamayxie 8e580dc374 fix LICENSES file 2026-01-15 16:41:54 -08:00
angelamayxie 2406c2ed88 Merge branch 'aaron/update-ci-check-repo' of https://github.com/dolthub/dolt into nicktobey-eeb3f7f5 2026-01-15 16:40:24 -08:00
Aaron Son efed9c3b6d .github/workflows/ci-check-repo.yaml: Make the action step which updates Godeps/LICENSES look more like update.sh. 2026-01-15 16:06:35 -08:00
elianddb 723500a1b4 Merge remote-tracking branch 'origin/elian/dckrerr' into elian/dckrerr 2026-01-15 15:56:26 -08:00
elianddb 17da195ee5 add virtual file systems 2026-01-15 15:55:51 -08:00
coffeegoddd 51bd1ef6c0 [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2026-01-15 23:49:26 +00:00
nicktobey 96d1aecebc [ga-bump-dep] Bump dependency in Dolt by nicktobey 2026-01-15 23:40:01 +00:00
elianddb 3e15ca9111 [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2026-01-15 23:21:38 +00:00
elianddb e3cacaaf24 rm volume from bats test 2026-01-15 15:12:19 -08:00
Aaron Son ceeb9f5c8f go/store/nbs: file_manifest.go: Always make manifest writes crash safe. Remove optional async manifest write support.
Online GC could write new tale files to oldgen, and the manifest write was not crash safe. This could result in data loss depending on filesystem settings if there was an inopportune crash.
2026-01-15 14:38:42 -08:00
coffeegoddd ae854b79eb [ga-bump-release] Update Dolt version to 1.80.2 and release v1.80.2 v1.80.2 2026-01-15 22:19:42 +00:00
Neil Macneale IV 55e8b98dad Merge pull request #10313 from dolthub/macneale4/perms-error
When DB files can't be read off disk, fail with a clear error rather than a panic
2026-01-15 13:22:12 -08:00
Brian Hendriks 4dd08b249b Merge pull request #10305 from dolthub/bh/system-metrics
gauges measuring percentage of CPU, virtual memory, and disk used
2026-01-14 11:04:20 -08:00
Dustin Brown 91968954d1 Merge pull request #10310 from dolthub/db/builder
[no-release-notes] /go/performance/utils: add error info
2026-01-14 10:47:37 -08:00
Brian Hendriks 212785b280 verify to match update 2026-01-13 17:13:25 -08:00
Brian Hendriks 1dc1e330c8 Another LICENSES update attempt 2026-01-13 17:02:55 -08:00
Brian Hendriks 26b46809ae licenses fix 2026-01-13 16:27:17 -08:00
Brian Hendriks f9aa7a4bfa fix 2026-01-13 16:05:22 -08:00
Neil Macneale IV 6ab64f393b When DB files can't be read off disk, fail with a clear error rather than a panic 2026-01-13 15:41:46 -08:00
coffeegoddd☕️✨ dcbda3b773 /go/performance/utils: add error info 2026-01-13 10:28:35 -08:00
Brian Hendriks 5423ada287 pr feedback 2026-01-12 15:33:26 -08:00
Brian Hendriks c3eb1686e4 fix 2026-01-12 15:30:52 -08:00
Brian Hendriks e837bc02b3 pr feedback 2026-01-12 15:04:28 -08:00
Brian Hendriks 05f02970d9 comment out debug code 2026-01-12 15:02:38 -08:00
Brian Hendriks 10d8de87cb Update go/cmd/dolt/commands/sqlserver/metrics_listener.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-12 15:00:09 -08:00
Brian Hendriks b5652e05a1 log message fixes 2026-01-12 14:56:38 -08:00
Neil Macneale IV c408c09500 Merge pull request #10293 from dolthub/macneale4-claude/branch-vv
Add support for -vv for `dolt branch` command
2026-01-12 13:25:43 -08:00
Brian Hendriks 2e0e0e10aa gauges measuring percentage of CPU, virtual memory, and disk used 2026-01-12 13:21:12 -08:00
Neil Macneale IV 2e8824b7b0 Handle panic in test 2026-01-12 20:46:56 +00:00
Neil Macneale IV 025aa1d8c8 PR Feedback 2026-01-12 19:39:29 +00:00
coffeegoddd 8375e3cb34 [ga-bump-release] Update Dolt version to 1.80.1 and release v1.80.1 v1.80.1 2026-01-10 00:03:18 +00:00
angelamayxie e64703780d Merge pull request #10302 from dolthub/angelamayxie-eb63e475
[auto-bump] [no-release-notes] dependency by angelamayxie
2026-01-09 15:16:40 -08:00
angelamayxie 05f7f29b82 [ga-bump-dep] Bump dependency in Dolt by angelamayxie 2026-01-09 21:59:04 +00:00
Neil Macneale IV 0c7cea0a7b simplify 2026-01-09 02:33:29 +00:00
Neil Macneale IV 612edcc408 fomat with dynamic space and simplify 2026-01-09 01:51:41 +00:00
macneale4 0dd890c782 add -vv support to dolt branch 2026-01-08 16:37:49 -08:00