-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
IGNITE-21013 Support encryption of cache dumps #11078
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's clarify in docs difference between snapshots and dumps when we talk about encryption. Snapshots can contain encrypted pages, while Dumps encrypt entry by self.
.../org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
Show resolved
Hide resolved
@@ -139,7 +142,8 @@ public SnapshotMetadata( | |||
@Nullable WALPointer snpRecPtr, | |||
@Nullable byte[] masterKeyDigest, | |||
boolean onlyPrimary, | |||
boolean dump | |||
boolean dump, | |||
byte[] encKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
* Map shared across all instances of {@link PartitionDumpContext} and {@link DumpEntrySerializer}. | ||
* Used to store encrypted data in case dump encrypted. | ||
*/ | ||
private final ConcurrentMap<Long, ByteBuffer> encThLocBufs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
if (encrypted && !Arrays.equals(meta.masterKeyDigest(), encSpi.masterKeyDigest())) { | ||
throw new IllegalArgumentException("Dump '" + | ||
meta.snapshotName() + "' has different master key digest. To restore this " + | ||
"snapshot, provide the same master key."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snapshot -> dump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
buf.putInt(crc.getValue()); | ||
|
||
buf.position(0); | ||
|
||
return buf; | ||
} | ||
|
||
/** */ | ||
private static int plainDataSize( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's inline this method. It will reduce code changes
|
||
plainBuf.limit(plainBuf.capacity()); | ||
|
||
if (plainBuf.capacity() < buf.limit()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove curly braces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
(cherry picked from commit 668939a)
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com #ignite channel.