Fixing page pruning / compaction crash #15
Merged
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.
Issue: the heap AM has a function which automatically compacts pages when certain conditions are met. When this happens, it moves the tuples around within the page. As encryption uses the offset of tuples for decrypting them, this results in garbage data and possible crashes.
Fix: this commit copies the two compaction functions from the server code, and modifies them to re-encrypt data when moved. This is not optimized at all, if needed, we can improve this by a lot.
Also, for now only one execution path is handled from the two, as that's the only one hit by sysbench. We'll have to figure out a testcase for the other and fix that too, for now, it only contains an assert(0).