Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-DbaBackupInformation - Fix size information for striped backups #8330

Merged
merged 2 commits into from
May 17, 2022

Conversation

andreasjordan
Copy link
Contributor

Type of Change

  • Bug fix (non-breaking change, fixes Get-DbaBackupInformation - Sizes are incorrectly summed #8302 )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (effects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Every file of a striped backup contains the size information about the backup itself, not the individual file. So the size can just be fetched from the first backup file like most other information.

Before:

image

After:
image

@potatoqualitee
Copy link
Member

ahhh now i remember! this is TotalSize vs Size -- that's why the TotalSized is summed. Can you do that? We may need an Add-Member

@andreasjordan
Copy link
Contributor Author

ahhh now i remember! this is TotalSize vs Size -- that's why the TotalSized is summed. Can you do that? We may need an Add-Member

Sorry, I don't understand. Can you explain?

@potatoqualitee
Copy link
Member

Your PR proposes to change the value of the TotalSize column. The TotalSize column was intended to be a summary size of the whole backup, not the file itself, which is why it's called TotalSize and not Size.

So we can add a backup size for the individual file, it'll just have to be a differently named column, perhaps Size.

@andreasjordan
Copy link
Contributor Author

andreasjordan commented May 9, 2022

The output of Get-DbaBackupInformation does not list information about individual files. A striped backup only has one object returned. That is done via the Group-Object.

Some pictures...

I have taken two backups of Adventureworks:
image

The filesystem says:
image

The command says:
image

So in case of the striped backup, both files of around 100 kByte are part of same backup and their headers include the information "Backupsize = 200 kByte". The size of the file is not found - and not needed, as we don't return information about files.

So we only have - and only need - one "Size" information, currently named "TotalSize" (and one for the compressed value named "CompressedBackupSize").

So I still think my PR fixes a bug.

@potatoqualitee
Copy link
Member

@ClaudioESSilva and i are still working through this as I still need convincing there should not be a totalsize AND size and im doing a sanity check 😊

@potatoqualitee
Copy link
Member

i cant get the numbers to be different so this works for me since it works for yall 😅

@potatoqualitee potatoqualitee merged commit 5402c2c into development May 17, 2022
@potatoqualitee potatoqualitee deleted the GetDbaBackupInformation_fix_size branch May 17, 2022 13:25
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.

Get-DbaBackupInformation - Sizes are incorrectly summed
3 participants