mssqlvdi-fd: add support for filestream backups#2072
Merged
Conversation
afd26d9 to
2674c03
Compare
2674c03 to
9134b30
Compare
sebsura
commented
Feb 13, 2025
Contributor
Author
sebsura
left a comment
There was a problem hiding this comment.
We should also have a test that actually back ups/ restores a filestream object.
systemtests/tests/mssqlvdi-plugin/testrunner-12-DBFileStream-FullBackup
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/testrunner-13-DBFileStream-IncBackup
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/testrunner-15-DBFileStream-Restore
Outdated
Show resolved
Hide resolved
336ad68 to
30c6bb6
Compare
2c6b663 to
a9cba08
Compare
91decd4 to
fcad22f
Compare
8f1bbac to
2217719
Compare
bruno-at-bareos
requested changes
Mar 17, 2025
Contributor
There was a problem hiding this comment.
In this last review I've added or confirmed some request changes asked by @sebsura
A complete manual test on a separated host with database with other name has been successfully backup-ed and restored. Especially checked the recreation of the Attachment folder.
Plus we need to address the last bits of complain from pr-tool
✗ Commit checks failed:
221771925 [fixup] tests: add debug logging: headline starts with '[fixup]'
fcad22f9c [fixup] remove `set -x`: headline starts with '[fixup]'
✗ bareos-check-sources --since=13c0881293fcb435b9aeb1dcce42f124ba3bfd65 reported:
Plugin 'fix copyright year' would modify 'core/src/plugins/filed/CMakeLists.txt'
systemtests/tests/mssqlvdi-plugin/etc/bareos/bareos-dir.d/pool/purgeoldest.conf
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/etc/bareos/bareos-dir.d/pool/quickrecycle.conf
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/etc/bareos/bareos-dir.d/storage/File.conf.in
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in
Outdated
Show resolved
Hide resolved
14 tasks
9f25f65 to
317dfe2
Compare
bruno-at-bareos
requested changes
Mar 24, 2025
Contributor
bruno-at-bareos
left a comment
There was a problem hiding this comment.
We're almost done. I requested a few changes please check them.
systemtests/tests/mssqlvdi-plugin/sqlfiles/SQL_db_filestream_drop_create.sql
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/sqlfiles/SQL_db_normal_drop_create.sql
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/sqlfiles/SQL_drop_tables_schemas.sql
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/testrunner-01-DBNormal-prepare
Outdated
Show resolved
Hide resolved
systemtests/tests/mssqlvdi-plugin/testrunner-11-DBFileStream-prepare
Outdated
Show resolved
Hide resolved
41c46c2 to
f9a4b8b
Compare
7 tasks
See here: https://techcommunity.microsoft.com/blog/sqlserver /introducing-vdc-complete-for -backup-and-restore-applications-using-sqlvdi/385126
We use a standard DB called `DBNormalTest` with simple table `samples` and a `Filestream` feature enabled database `DBFilestreamTest` with two tables `samples` and `files` - setup license on all testrunner and sqlfiles - find_program SQLCMD: remove HINTS - use recommend primary key for filestream table `UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL UNIQUE` - environment.in: move SQLCMD upwards - minimize configuration files - properly escape all variables (shellcheck) - remove set -x in testrunner-01-DBNormal-prepare testrunner-11-DBFileStream-prepare - make tests portable on `CORE` so use `regedit.exe` and `write.exe` as sample for Filestream `files` table Co-authored-by: Philipp Storz <philipp.storz@bareos.com> Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
f9a4b8b to
b9a3fa5
Compare
bruno-at-bareos
approved these changes
Mar 26, 2025
Contributor
bruno-at-bareos
left a comment
There was a problem hiding this comment.
final review, with approval.
7 tasks
c25f471 to
40b20bf
Compare
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for contributing to the Bareos Project!
The plugin was written during a time where the
VDC_Flushcommand was only emitted at the end of a backup.This caused our logic to conflate the two: whenever
VDC_Flushwas requested, we told the core (implicitly by returning count=0 from read) that the single file we backup is done.As mentioned in this article this is (and was) always a bad assumption.
Fixing this without changing the complete logic of the plugin was hard, but thanks to the introduction of the
VDC_Completecommand it was possible.The way it works is like so: When starting a backup, we request from the vdi device that it should notify us when the backup is complete by setting
VDF_RequestCompletein the configuration.If this succeeds (
completion_support = true) then during IO operations we ignoreVDC_Flushand continue on until we hitVDC_Completeat which point we actually tell the core that we are done.This also fixes a small mistake from #2120.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality
Tests