Remove built-in decompression flag#10670
Conversation
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
deepthi
left a comment
There was a problem hiding this comment.
Code changes look fine to me.
Do we have an update/downgrade test that verifies that we can restore a backup taken with an older version binary even if we provide new flags to the binary we are restoring with?
Also need to update release notes summary file, and related website PR vitessio/website#1091 (cc @rvrangel)
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
|
The idea behind a separate In that case we would benefit of being able to set an external compressor but use a more convenient builtin decompressor. This change introduces a new I think it is a good idea to also add the compression engine to the |
The extension point you mentioned above does make sense and probably we can get rid of it. The problem with previous approach was consider a scenario where you decide to move from lz4 to pgzip. In that case the transition will be two phase first (step) you only change value of compressor to pgzip and keep the decompressor to still lz4 so latest backup can be decompressed and then as soon as you get your first backup with new compressor pgzip then you have to now change your decompressor to pgzip (second step). The whole idea of reading from manifest is to make logic simple else we will run into a lot of edge cases. |
|
If you want to move engines, you can (and should) keep Perhaps if you want to simplify the logic, another option would be to replace |
Why do you need --external-compressor-engine separately, you can use *builtin-compressor to write to manifest just like you are doing it in Builtin-Engine. |
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
maxenglander
left a comment
There was a problem hiding this comment.
I was asked to take a look at this and offer perspective on how this will affect PlanetScale and PS customers. Just a couple questions for now. Thanks!
|
Removed the |
It would be nice if there was a way to deal with this with a set of flags, e.g. |
maxenglander
left a comment
There was a problem hiding this comment.
Aside from some notes I left on usability and documentation above, I think this PR will add the flexibility we need to address the first three bullet points in this issue.
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
+1 on the docs. We'll need to do a website PR and add the details there. |
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
…itessio#950) * Backup/Restore: add support for external compressors and decompressors (vitessio#10558) * change to support an external decompressor Signed-off-by: Renan Rangel <renan@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * add external compressor support + builtin additional compressors Signed-off-by: Renan Rangel <renan@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * wrap external compressor/decompressor Signed-off-by: Renan Rangel <renan@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * go mod tidy + comments Signed-off-by: Renan Rangel <renan@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * add copyright notices Signed-off-by: Renan Rangel <renan@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * add support for builtin engine Signed-off-by: Renan Rangel <rrangel@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Adding test case for buckup compression Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing unit test and run mod tidy Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Removing unwanted unit tests Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Increase timeout of backup tests Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * fixing linter errors Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Change test logic to accomodate running selective tests Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * removing lint warning Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * fixing test failure Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Removing un-necessary test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing code review feeback Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Change builtinEngine to consider 'auto' decompressor Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * fixing Upgrade/Downgrade test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fix type & add summary under release notes Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing typos in summary Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing flag name typos Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> Co-authored-by: Renan Rangel <rrangel@slack-corp.com> Co-authored-by: Renan Rangel <renan@slack-corp.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * cherry-pick some how didn't took the right code for test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Remove built-in decompression flag (vitessio#10670) * Remove built-in decompression flag Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fix test failures Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fix Helpoutput test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing unit test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Adding summary Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * code cleaning and better summary Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Change builtinCompressor to more generic compression engine name Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing / Adding new test case Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fix summary & static code analysis Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Adding fake backup impl in test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Adding time sleep in between test Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing summary and adding comments Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Feedback on summary Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Code review feedback Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing comment Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing default value in summary Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing test cases Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * More summary fixes Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> * Fixing TestHelpOutput Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com> Co-authored-by: Renan Rangel <rrangel@slack-corp.com> Co-authored-by: Renan Rangel <renan@slack-corp.com>
Signed-off-by: Rameez Sajwani rameezwazirali@hotmail.com
Description
This PR includes bunch of optimization and some changes around backward compatibility scenario.
1- Making code logic of deducing decompressor between Built-in and XtraBackup same.
2- We don't need decompressor flag given we are always going to write what is the built-in compression used in MANIFEST
3- Adding compression engine field in Xtrabackup MANIFEST
4- Addressing the scenario when MANIFEST file does not contain any value for compression engine. We should default to what we were using before which is "gzip". This can happen if the backup is done using vitess version <= v14 and we try to restore using main / v15
5- Introducing 'external' as one of possible value of compression engine. External specify if we are using custom flags or custom tool for compression and decompression.
6- Rename built-in compressor to more generic name 'compression-engine-name'
7- Change mysql version to 8.0.28 for upgrade-downgrade test
With this change here are the possible value of
--compression-engine-namewhere 'external' is set only when we are using compressor other than the ones mentioned above. If you want to use any of the built-in compressors, simply set one of the above values for
--compression-engine-name. Value specified in--compression-engine-nameis saved in MANIFEST, which is later read by restore routine to decide what engine to use for decompression. Default value for engine is 'pgzip'Details
Xtrabackup engine was using file extension as a mean to determine the value of compressor during decompression, whereas built-in engine was using MANIFEST file to find out the value of compressor. This PR will make both engine use same logic which is to read it from MANIFEST file to determine the engine used during compression. As a result we found out that we don't need flags like Built-in decompressor. Furthermore we realized that Builtin-engine is used as a hint for decompressor to find out the compression engine name, so we changed its name to more generic 'compression-engine-name'. Here is the list of different scenarios (possible values) which client can provide to these flags.
Use Cases
1 (Use pgzip as compressor and decompressor)
compression-engine: pgzip
External compression: “”
External decompression: “”
2 (Use some external command as compressor and decompressor)
compression-engine: “external”
External compression: externalTool -c -y
External decompression: externalTool -d -y
external-compressor-extension: .xyz
3 (Use custom lz4 as compression and default built-in lz4 as decompressor)
compression-engine: “lz4”
External compression: lz4 -flag
External decompression:
4 (Use custom lz4 as compression and decompressor)
compression-engine: “external”
External compression: lz4 -flag
External decompression: lz4 -flag
Migration Cases:
Original state:
compression-engine: “gzip”
External compression: “”
External decompression: “”
Final state:
compression-engine: “lz4”
External compression: “”
External decompression: “”
Original state:
compression-engine: “pgzip”
External compression: “”
External decompression: “”
Final state:
compression-engine: “pgzip”
External compression: “pgzip -flag”
External decompression: “”
Original state:
compression-engine: “pgzip”
External compression: “”
External decompression: “”
Final state:
compression-engine: “external”
External compression: “external -c -flag”
External decompression: “external -d -flag”
Original state:
compression-engine: “external”
External compression: “custom -c flag”
External decompression: “custom -d flag”
Intermediate state:
compression-engine: “lz4”
External compression: “”
External decompression: “external -d -flag”
finale state:
compression-engine: “lz4”
External compression: “”
External decompression: “”
Original state:
compression-engine: “pgzip”
External compression: “pgzip -c”
External decompression: “”
final state:
compression-engine: “lz4”
External compression: “lz4 -c”
External decompression: “”
Original state:
compression-engine: “pgzip”
External compression: “”
External decompression: “”
Wont work:
compression-engine: “pgzip”
External compression: “”
External decompression: “pgzip -c”
final state:
compression-engine: “external”
External compression: “pgzip -c”
External decompression: “pgzip -c flag”
Original state:
compression-engine: “external”
External compression: “tool -c”
External decompression: “tool -d”
final state:
compression-engine: “external”
External compression: “tool2 -c”
External decompression: “tool1 -d”
P.S: In this case #11 we will run into issue where some of the older backups won't get restore after final state unless tool1 and tool2 are compatible.
Related Issue(s)
#7802
Checklist
Deployment Notes