HDDS-8904. Fix Snapdiff output for key renames#5177
HDDS-8904. Fix Snapdiff output for key renames#5177hemantk-12 merged 3 commits intoapache:masterfrom
Conversation
|
@hemantk-12 could you please help to review this? |
hemantk-12
left a comment
There was a problem hiding this comment.
Thanks for the patch @swamirishi.
I am still not not clear why this change is needed because initial change was done as part HDDS-8841. Is it related to FSO bucket? Or Legacy and OBS as well? It would be great if you could add an examples of difference between before and after the change in the description. Or difference between Ozone and HDFS.
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Show resolved
Hide resolved
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Outdated
Show resolved
Hide resolved
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Outdated
Show resolved
Hide resolved
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Outdated
Show resolved
Hide resolved
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Outdated
Show resolved
Hide resolved
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Outdated
Show resolved
Hide resolved
...one/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java
Outdated
Show resolved
Hide resolved
@hemantk-12 Added this in the description |
|
|
||
| @Override | ||
| public byte[] toPersistedFormat(Boolean object) { | ||
| return object ? new byte[]{TRUE} : new byte[]{FALSE}; |
There was a problem hiding this comment.
nit: create constants for new byte[]{TRUE} and new byte[]{FALSE};
hemantk-12
left a comment
There was a problem hiding this comment.
Thanks @swamirishi for adding examples in the descriptions.
I did comparison between current and after the change and below is the diff for different scenarios.
- Renamed to same key for non-dir keys: keya -> keyb -> keyc -> keya
Before the change:
M ./keya
After the change:
R ./keya -> ./keya
- Renamed to same key for key in a dir: dir1/key1 -> dir1/key2 -> dir1/key1
Before the change:
M ./dir1
M ./dir1/key1
After the change:
R ./dir1/key1 -> ./dir1/key1
M ./dir1
- Key is overridden and renamed key: non dir key
Before the change:
R ./key11 -> ./key12
M ./key11
After the change:
R ./key11 -> ./key12
M ./key11
- Key is overridden and renamed key: key with dir
Before the change:
R ./dir1/key1 -> ./dir1/key2
M ./dir1/key1
M ./dir1
After the change:
R ./dir1/key1 -> ./dir1/key2
M ./dir1
M ./dir1/key1
Based on above testing, change looks good to me.
(cherry picked from commit e03e9f3) Change-Id: I0f440e610ac4897a3c5b7491214b7ad0f64857ec
What changes were proposed in this pull request?
Currently snapdiff shows modify entry for keys which have undergone a series of rename and gets renamed back to the same name. HDFS currently shows a rename for such cases.
There is a difference b/w Ozone & HDFS output:
HDFS Ouput
Difference between snapshot s0 and snapshot s1 under directory /:
M .
R ./foo -> ./foo
Ozone Output before change
Difference between snapshot: snap1 and snapshot: snap2
M ./dir1
M ./dir1/k12
Ozone Output after change
Difference between snapshot: snap1 and snapshot: snap2
R ./dir1/k12 -> ./dir1/k12
M ./dir1
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8904
How was this patch tested?
Unit tests and Integration tests