Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
6e241f6
HDDS-13765. SnapshotLocalData yaml should also track snapshotId
swamirishi Oct 8, 2025
a869500
HDDS-13627. In memory Manager for Snapshot Local Data
swamirishi Oct 8, 2025
252d338
HDDS-13627. In memory Manager for Snapshot Local Data
swamirishi Oct 9, 2025
4099bc6
HDDS-13767. Refactor SnapshotLocalDataYaml related code into OmSnapsh…
swamirishi Oct 9, 2025
e02670c
HDDS-13767. Fix pmd
swamirishi Oct 9, 2025
5a66cfc
Merge remote-tracking branch 'origin/HDDS-13767' into HEAD
swamirishi Oct 9, 2025
79580e9
HDDS-13627. Fix checkstyle
swamirishi Oct 9, 2025
2a331ef
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 9, 2025
c4f69e2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 10, 2025
afbc592
HDDS-13627. Add tests
swamirishi Oct 10, 2025
70ac2c7
HDDS-13783. Implement locks for OmSnapshotLocalDataManager
swamirishi Oct 12, 2025
b554cc7
HDDS-13783. Implement locks for OmSnapshotLocalDataManager
swamirishi Oct 12, 2025
49eccfa
HDDS-13783. Refactor inline variable
swamirishi Oct 12, 2025
51eda04
HDDS-13627. Refactor map data structure
swamirishi Oct 13, 2025
25f766c
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 13, 2025
96689fa
HDDS-13783. Add more condition to upsert
swamirishi Oct 13, 2025
0674299
HDDS-13783. Add java doc comment
swamirishi Oct 13, 2025
5d9fc49
HDDS-13783. Add java doc comment
swamirishi Oct 13, 2025
2d88176
HDDS-13783. Implement full lock
swamirishi Oct 13, 2025
a3c4c69
HDDS-13783. Refactor and move modify method into WritableOmSnapshotLo…
swamirishi Oct 13, 2025
686d0c7
HDDS-13783. Make full lock non static
swamirishi Oct 13, 2025
491a54b
HDDS-13783. Fix remove
swamirishi Oct 13, 2025
5e69ee9
HDDS-13627. Fix findbugs
swamirishi Oct 13, 2025
d36622a
HDDS-13785. Remove orphan versions from SnapshotLocalData Yaml file
swamirishi Oct 14, 2025
ee213d1
HDDS-13785. Fix findbugs
swamirishi Oct 14, 2025
81871b2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 14, 2025
a95604e
HDDS-13627. Fix tests
swamirishi Oct 14, 2025
5a90fcf
HDDS-13627. remove checksum interface
swamirishi Oct 14, 2025
20d7d6a
HDDS-13627. Fix test failures
swamirishi Oct 14, 2025
ae655cb
HDDS-13785. Set defrag flag on previous snapshotId update
swamirishi Oct 14, 2025
25fa6ae
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 14, 2025
d419283
HDDS-13783. Fix findbugs
swamirishi Oct 14, 2025
8a44308
HDDS-13783. Fix pmd
swamirishi Oct 14, 2025
cb94c36
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 14, 2025
e26052c
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 14, 2025
4d272d1
HDDS-13783. Fix lock release
swamirishi Oct 14, 2025
2a38f59
HDDS-13627. address review comments
swamirishi Oct 14, 2025
ca098cf
HDDS-13783. Make graph updates synchronized
swamirishi Oct 15, 2025
67d4b3d
HDDS-13627. Make add version with dependents package private
swamirishi Oct 15, 2025
9838cda
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 15, 2025
6a19dbb
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 15, 2025
665f411
HDDS-13783. Fix checkstyle
swamirishi Oct 15, 2025
2894e40
HDDS-13783. Fix merge conflict
swamirishi Oct 15, 2025
ea0ab16
HDDS-13783. Add write version api
swamirishi Oct 15, 2025
915562b
HDDS-13797. Refactor OzoneManagerLock Resource class to handle handle…
swamirishi Oct 15, 2025
1c0d0ac
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 15, 2025
24da3eb
HDDS-13797. Update interface
swamirishi Oct 15, 2025
8f3774a
HDDS-13798. Implement PoolBasedHierarchicalResourceLockManager for Hi…
swamirishi Oct 15, 2025
503cd4e
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
6865fad
HDDS-13797. Revert move of Leveled Resource and Resource enum/interface
swamirishi Oct 15, 2025
903ecd1
Merge remote-tracking branch 'origin/HDDS-13797' into HEAD
swamirishi Oct 15, 2025
06d1e99
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
60a7728
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 15, 2025
4711517
HDDS-13798. Fix pmd findbugs
swamirishi Oct 15, 2025
af8754c
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
655a724
HDDS-13798. Fix pmd findbugs
swamirishi Oct 15, 2025
6386c1b
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
2bc6134
HDDS-13798. Fix ozone-default.xml
swamirishi Oct 16, 2025
0de7c62
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 16, 2025
8e8c534
HDDS-13798. Stop lock data manager on metadata stop
swamirishi Oct 16, 2025
f148f24
HDDS-13798. Update tests
swamirishi Oct 16, 2025
da030c0
HDDS-13798. Rename class
swamirishi Oct 16, 2025
6af6498
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 16, 2025
b281569
HDDS-13783. Add tests
swamirishi Oct 16, 2025
1ad24b4
HDDS-13783. Fix checkstyle
swamirishi Oct 16, 2025
d629911
HDDS-13783. Fix findbugs
swamirishi Oct 16, 2025
2aecde4
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 16, 2025
8eeb44b
HDDS-13783. Fix pmd
swamirishi Oct 16, 2025
d9301b3
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 16, 2025
06e7d37
HDDS-13785. Fix merge issue
swamirishi Oct 16, 2025
efd6c51
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 16, 2025
fab85ea
HDDS-13785. Fix checkstyle
swamirishi Oct 16, 2025
c73a355
HDDS-13783. Fix test
swamirishi Oct 16, 2025
76b99e2
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 16, 2025
1d39bee
HDDS-13785. Fix test
swamirishi Oct 16, 2025
54f1508
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 16, 2025
b1a3834
HDDS-13785. Fix test
swamirishi Oct 16, 2025
1986bbe
HDDS-13785. Fix conditions
swamirishi Oct 16, 2025
52be3dd
HDDS-13783. Allow version resolution to null
swamirishi Oct 16, 2025
5f50a04
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 16, 2025
908c47d
HDDS-13785. Fix tests
swamirishi Oct 17, 2025
278605a
HDDS-13783. Add dirty bit
swamirishi Oct 17, 2025
40265e1
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 17, 2025
ac4719b
Merge
swamirishi Oct 17, 2025
cf19dce
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
34097de
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
c46ddc2
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
99afc02
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
fcc630e
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 17, 2025
6f144e2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 17, 2025
4600c96
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 18, 2025
48ec0bb
HDDS-13810. Fix Build Issue because of unused dependency
swamirishi Oct 18, 2025
f524cad
Merge remote-tracking branch 'origin/HDDS-13810' into HEAD
swamirishi Oct 18, 2025
cb31b7c
Revert "HDDS-13810. Fix Build Issue because of unused dependency"
swamirishi Oct 19, 2025
02dd061
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 19, 2025
ff90af8
HDDS-13785. Add unit tests
swamirishi Oct 20, 2025
8b014dd
HDDS-13783. Add case for commit key in middle of chain
swamirishi Oct 20, 2025
57662c6
HDDS-13783. Convert set to list of predecessors
swamirishi Oct 20, 2025
bcc0fc8
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 20, 2025
79a46f4
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 23, 2025
cd24a81
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 23, 2025
5f0bb91
HDDS-13833. Add transactionInfo field in SnapshotLocalData and update…
swamirishi Oct 24, 2025
3de4346
Merge remote-tracking branch 'origin/HDDS-13833' into HEAD
swamirishi Oct 24, 2025
5b55a59
HDDS-13785. Merge with HDDS-13833
swamirishi Oct 24, 2025
aa6facf
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 24, 2025
cc35056
HDDS-13783. Make local data graph synchrnous
swamirishi Oct 25, 2025
9c1689c
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 25, 2025
3f59895
HDDS-13785. Use internal lock on orphan block cleanup
swamirishi Oct 25, 2025
95341dd
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 27, 2025
616bef3
HDDS-13783. Fix NPE with concurrentHashMap
swamirishi Oct 27, 2025
b0023d1
HDDS-13830. Snapshot Rocks DB directory path computation based on loc…
swamirishi Oct 28, 2025
36b6fb3
HDDS-13830. Add test
swamirishi Oct 28, 2025
4596386
HDDS-13783. Add comments for localDataGraph
swamirishi Oct 29, 2025
7af6521
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 29, 2025
e19dae2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 29, 2025
8c1373a
Merge remote-tracking branch 'origin/HDDS-13833' into HEAD
swamirishi Oct 29, 2025
25ee4e2
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 29, 2025
c6e3914
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 29, 2025
fd4bfdb
HDDS-13785. Add test for handling needs defrag
swamirishi Oct 30, 2025
49f4424
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 30, 2025
613d106
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 30, 2025
8a29736
HDDS-13833. Fix checkstyle
swamirishi Oct 30, 2025
cca2dbf
Merge remote-tracking branch 'origin/HDDS-13833' into HEAD
swamirishi Oct 30, 2025
a810cc1
HDDS-13785. Fix findbugs
swamirishi Oct 30, 2025
78c1036
HDDS-13859. OmSnapshotLocalDataManager should handle needsDefrag flag…
swamirishi Oct 31, 2025
a2bbea5
Merge remote-tracking branch 'origin/HDDS-13859' into HEAD
swamirishi Oct 31, 2025
bf4746f
HDDS-13859. Fix Test
swamirishi Oct 31, 2025
09d955c
HDDS-13859. Add comments
swamirishi Oct 31, 2025
cde567d
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 31, 2025
49c662a
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 31, 2025
2cf1bce
HDDS-13859. Fix test after merge master
swamirishi Oct 31, 2025
7afc8f5
Merge remote-tracking branch 'origin/HDDS-13859' into HEAD
swamirishi Oct 31, 2025
5849dac
HDDS-13785. Fix tests after merge
swamirishi Oct 31, 2025
e58ff09
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 31, 2025
83b887e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 31, 2025
519495a
HDDS-13785. Address review comments
swamirishi Oct 31, 2025
c125250
HDDS-13785. Address review comments
swamirishi Oct 31, 2025
408e213
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 1, 2025
715b2f0
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 1, 2025
ec59b89
HDDS-13785. Address review comments
swamirishi Nov 1, 2025
b0b6d6a
HDDS-13785. Address review comments
swamirishi Nov 1, 2025
a759807
HDDS-13785. Change catch exception
swamirishi Nov 1, 2025
808b174
HDDS-13785. Address review comments
swamirishi Nov 1, 2025
c829a8b
HDDS-13830. Fix test
swamirishi Nov 1, 2025
8e91e47
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 1, 2025
bfd341c
HDDS-13830. Fix test
swamirishi Nov 1, 2025
4ccd3fc
HDDS-13830. Fix test
swamirishi Nov 1, 2025
4fd3b0e
HDDS-13849. Refactor getTablePrefix function in SnapshotDiff flow
swamirishi Nov 1, 2025
41b7cfb
HDDS-13830. Fix pmd
swamirishi Nov 1, 2025
3a8c8f6
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 2, 2025
d0422ae
HDDS-13830. Fix mrge issue
swamirishi Nov 2, 2025
4ff8cea
Merge remote-tracking branch 'origin/HDDS-13830' into HEAD
swamirishi Nov 2, 2025
649468d
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi Nov 3, 2025
bb5139f
HDDS-13452. Prevent snapshot defrag from happening before upgrade fin…
swamirishi Nov 3, 2025
c46e1ae
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 3, 2025
298ae36
HDDS-13849. Fix test
swamirishi Nov 3, 2025
8e43b90
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi Nov 3, 2025
55c68bd
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 3, 2025
d1d04cf
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 3, 2025
974b5c2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 3, 2025
018571c
HDDS-13785. Address review comments
swamirishi Nov 5, 2025
6cd54dd
HDDS-13785. Address review comments
swamirishi Nov 5, 2025
261a669
HDDS-13785. Remove unnecessary read lock
swamirishi Nov 5, 2025
8955d80
Merge remote-tracking branch 'origin/HDDS-13785' into HEAD
swamirishi Nov 6, 2025
ac88692
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 6, 2025
91c143a
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 6, 2025
151e887
HDDS-13867. SnapshotDiff delta file computation should happen based o…
swamirishi Nov 8, 2025
3771ff4
HDDS-13901. OmSnaphshotLocalDataManager should throw IOException if u…
swamirishi Nov 9, 2025
0736d82
Merge remote-tracking branch 'origin/HDDS-13901' into HEAD
swamirishi Nov 10, 2025
894a047
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 10, 2025
5823347
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 10, 2025
e3c9a94
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 10, 2025
6fbf8c7
HDDS-13849. Address review comments
swamirishi Nov 10, 2025
ed007a4
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi Nov 10, 2025
43923cb
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi Nov 10, 2025
ea64602
HDDS-13849. Address review comments
swamirishi Nov 10, 2025
0b16ef6
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi Nov 10, 2025
1507659
HDDS-13849. Address review comments
swamirishi Nov 10, 2025
4c2a175
Merge remote-tracking branch 'origin/HDDS-13849' into HEAD
swamirishi Nov 10, 2025
e2d5e83
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 11, 2025
9d4dd26
HDDS-13867. Fix Snaphsot dag diff exception handling
swamirishi Nov 11, 2025
d696ffa
HDDS-13912. Modularise Snapshot Delta file computer (Full Diff)
swamirishi Nov 11, 2025
8523dea
HDDS-13912. Fix create link logic
swamirishi Nov 12, 2025
9ee0298
HDDS-13912. Fix findbugs
swamirishi Nov 12, 2025
1d771e0
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 13, 2025
121977e
Merge remote-tracking branch 'origin/HDDS-13867' into HEAD
swamirishi Nov 13, 2025
9736247
HDDS-13867. Fix bug
swamirishi Nov 13, 2025
2167b03
HDDS-13867. Add test
swamirishi Nov 14, 2025
08156e4
HDDS-13867. Address review comments
swamirishi Nov 14, 2025
84a0352
Merge remote-tracking branch 'origin/HDDS-13867' into HEAD
swamirishi Nov 14, 2025
8890252
HDDS-13912. Address review comments
swamirishi Nov 14, 2025
1067935
HDDS-13912. Fix interface
swamirishi Nov 14, 2025
b086376
HDDS-13912. Fix exception message
swamirishi Nov 14, 2025
4b1cf63
HDDS-13929. Modularise Snapshot Delta file computer (Efficient Diff)
swamirishi Nov 17, 2025
9b2d4f8
HDDS-13929. Fix PMD
swamirishi Nov 17, 2025
a495846
HDDS-13949. Move dbTxSequenceNumber from SnapshotInfo to LocalDataYam…
swamirishi Nov 17, 2025
90c28de
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 18, 2025
df34dd1
Merge remote-tracking branch 'origin/HDDS-13912' into HEAD
swamirishi Nov 18, 2025
9d59f6d
Merge remote-tracking branch 'origin/HDDS-13929' into HEAD
swamirishi Nov 18, 2025
1e04711
HDDS-13929. Fix findbugs
swamirishi Nov 18, 2025
db0b5de
Merge remote-tracking branch 'origin/HDDS-13929' into HEAD
swamirishi Nov 18, 2025
6fc9a2c
HDDS-13949. Fix findbugs
swamirishi Nov 18, 2025
ed8ee79
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 18, 2025
ecb5084
Merge remote-tracking branch 'origin/HDDS-13912' into HEAD
swamirishi Nov 18, 2025
632c009
Merge remote-tracking branch 'origin/HDDS-13929' into HEAD
swamirishi Nov 18, 2025
1201350
HDDS-13929. Fix javadoc
swamirishi Nov 19, 2025
505d6c5
Merge remote-tracking branch 'origin/HDDS-13929' into HEAD
swamirishi Nov 19, 2025
edf0213
HDDS-13949. Add back snapshotPath init removed by mistake
swamirishi Nov 19, 2025
5c3efca
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 19, 2025
42ca3d7
HDDS-13929. Fix comment
swamirishi Nov 19, 2025
faa1380
HDDS-13929. Change error log to warn
swamirishi Nov 19, 2025
d3f3836
Merge remote-tracking branch 'origin/HDDS-13929' into HEAD
swamirishi Nov 19, 2025
ee66820
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 20, 2025
4a36e98
HDDS-13949. Address review comments from HDDS-13929
swamirishi Nov 20, 2025
668ca9d
HDDS-13949. Address review comments
swamirishi Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public final class OzoneConsts {
public static final String OM_SST_FILE_INFO_END_KEY = "endKey";
public static final String OM_SST_FILE_INFO_COL_FAMILY = "columnFamily";
public static final String OM_SLD_TXN_INFO = "transactionInfo";
public static final String OM_SLD_DB_TXN_SEQ_NUMBER = "dbTxSequenceNumber";

// YAML fields for .container files
public static final String CONTAINER_ID = "containerID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,7 @@ private Path getSSTFullPath(SstFileInfo sstFileInfo, Path... dbPaths) throws IOE
* @param dest destination snapshot
* @param versionMap version map containing the connection between source snapshot version and dest snapshot version.
* @param tablesToLookup tablesToLookup set of table (column family) names used to restrict which SST files to return.
* @return A list of SST files without extension.
* e.g. ["/path/to/sstBackupDir/000050.sst",
* "/path/to/sstBackupDir/000060.sst"]
* @return map of SST file absolute paths with extension to SstFileInfo.
*/
public synchronized Optional<Map<Path, SstFileInfo>> getSSTDiffListWithFullPath(DifferSnapshotInfo src,
DifferSnapshotInfo dest, Map<Integer, Integer> versionMap, TablePrefixInfo prefixInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ public final class SnapshotInfo implements Auditable, CopyObject<SnapshotInfo> {
private UUID pathPreviousSnapshotId;
private UUID globalPreviousSnapshotId;
private String snapshotPath; // snapshot mask
/**
* RocksDB's transaction sequence number at the time of checkpoint creation.
*/
private long dbTxSequenceNumber;
private boolean deepClean;
private boolean sstFiltered;
private long referencedSize;
Expand All @@ -98,7 +94,6 @@ private SnapshotInfo(Builder b) {
this.pathPreviousSnapshotId = b.pathPreviousSnapshotId;
this.globalPreviousSnapshotId = b.globalPreviousSnapshotId;
this.snapshotPath = b.snapshotPath;
this.dbTxSequenceNumber = b.dbTxSequenceNumber;
this.deepClean = b.deepClean;
this.sstFiltered = b.sstFiltered;
this.referencedSize = b.referencedSize;
Expand Down Expand Up @@ -221,7 +216,6 @@ public SnapshotInfo.Builder toBuilder() {
.setPathPreviousSnapshotId(pathPreviousSnapshotId)
.setGlobalPreviousSnapshotId(globalPreviousSnapshotId)
.setSnapshotPath(snapshotPath)
.setDbTxSequenceNumber(dbTxSequenceNumber)
.setDeepClean(deepClean)
.setSstFiltered(sstFiltered)
.setReferencedSize(referencedSize)
Expand Down Expand Up @@ -249,7 +243,6 @@ public static class Builder {
private UUID pathPreviousSnapshotId;
private UUID globalPreviousSnapshotId;
private String snapshotPath;
private long dbTxSequenceNumber;
private boolean deepClean;
private boolean sstFiltered;
private long referencedSize;
Expand Down Expand Up @@ -327,12 +320,6 @@ public Builder setSnapshotPath(String snapshotPath) {
return this;
}

/** @param dbTxSequenceNumber - RDB latest transaction sequence number. */
public Builder setDbTxSequenceNumber(long dbTxSequenceNumber) {
this.dbTxSequenceNumber = dbTxSequenceNumber;
return this;
}

/** @param deepClean - To be deep cleaned status for snapshot. */
public Builder setDeepClean(boolean deepClean) {
this.deepClean = deepClean;
Expand Down Expand Up @@ -441,7 +428,6 @@ public OzoneManagerProtocolProtos.SnapshotInfo getProtobuf() {
}

sib.setSnapshotPath(snapshotPath)
.setDbTxSequenceNumber(dbTxSequenceNumber)
.setDeepClean(deepClean);
return sib.build();
}
Expand Down Expand Up @@ -523,9 +509,7 @@ public static Builder builderFromProtobuf(
if (snapshotInfoProto.hasCreateTransactionInfo()) {
osib.setCreateTransactionInfo(snapshotInfoProto.getCreateTransactionInfo());
}

osib.setSnapshotPath(snapshotInfoProto.getSnapshotPath())
.setDbTxSequenceNumber(snapshotInfoProto.getDbTxSequenceNumber());
osib.setSnapshotPath(snapshotInfoProto.getSnapshotPath());

return osib;
}
Expand Down Expand Up @@ -568,14 +552,6 @@ public String getCheckpointDirName(int version) {
return getCheckpointDirName(getSnapshotId(), version);
}

public long getDbTxSequenceNumber() {
return dbTxSequenceNumber;
}

public void setDbTxSequenceNumber(long dbTxSequenceNumber) {
this.dbTxSequenceNumber = dbTxSequenceNumber;
}

/**
* Get the table key for this snapshot.
*/
Expand Down Expand Up @@ -761,7 +737,6 @@ public String toString() {
", pathPreviousSnapshotId: '" + pathPreviousSnapshotId + '\'' +
", globalPreviousSnapshotId: '" + globalPreviousSnapshotId + '\'' +
", snapshotPath: '" + snapshotPath + '\'' +
", dbTxSequenceNumber: '" + dbTxSequenceNumber + '\'' +
", deepClean: '" + deepClean + '\'' +
", sstFiltered: '" + sstFiltered + '\'' +
", referencedSize: '" + referencedSize + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class TestOmSnapshotInfo {
private static final UUID GLOBAL_PREVIOUS_SNAPSHOT_ID =
PATH_PREVIOUS_SNAPSHOT_ID;
private static final String SNAPSHOT_PATH = "test/path";
private static final long DB_TX_SEQUENCE_NUMBER = 12345L;

private SnapshotInfo createSnapshotInfo() {
return new SnapshotInfo.Builder()
Expand All @@ -59,7 +58,6 @@ private SnapshotInfo createSnapshotInfo() {
.setPathPreviousSnapshotId(PATH_PREVIOUS_SNAPSHOT_ID)
.setGlobalPreviousSnapshotId(GLOBAL_PREVIOUS_SNAPSHOT_ID)
.setSnapshotPath(SNAPSHOT_PATH)
.setDbTxSequenceNumber(DB_TX_SEQUENCE_NUMBER)
.setDeepClean(false)
.setSstFiltered(false)
.setReferencedSize(2000L)
Expand All @@ -84,7 +82,6 @@ private OzoneManagerProtocolProtos.SnapshotInfo createSnapshotInfoProto() {
.setPathPreviousSnapshotID(toProtobuf(PATH_PREVIOUS_SNAPSHOT_ID))
.setGlobalPreviousSnapshotID(toProtobuf(GLOBAL_PREVIOUS_SNAPSHOT_ID))
.setSnapshotPath(SNAPSHOT_PATH)
.setDbTxSequenceNumber(DB_TX_SEQUENCE_NUMBER)
.setDeepClean(false)
.setSstFiltered(false)
.setReferencedSize(2000L)
Expand Down Expand Up @@ -164,8 +161,6 @@ public void testSnapshotInfoProtoToSnapshotInfo() {
snapshotInfoActual.getBucketName());
assertEquals(snapshotInfoExpected.getSnapshotStatus(),
snapshotInfoActual.getSnapshotStatus());
assertEquals(snapshotInfoExpected.getDbTxSequenceNumber(),
snapshotInfoActual.getDbTxSequenceNumber());
assertEquals(snapshotInfoExpected.isDeepCleaned(),
snapshotInfoActual.isDeepCleaned());
assertEquals(snapshotInfoExpected.isSstFiltered(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ private DifferSnapshotVersion getDifferSnapshotInfo(
throw new IllegalStateException(String.format("Duplicate key %s", u));
}, TreeMap::new));
DifferSnapshotInfo dsi = new DifferSnapshotInfo((version) -> Paths.get(checkpointPath),
snapshotInfo.getSnapshotId(), snapshotInfo.getDbTxSequenceNumber(), versionSstFiles);
snapshotInfo.getSnapshotId(), snapshotLocalData.getSnapshotLocalData().getDbTxSequenceNumber(),
versionSstFiles);
return new DifferSnapshotVersion(dsi, 0, COLUMN_FAMILIES_TO_TRACK_IN_DAG);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ message SnapshotInfo {
optional hadoop.hdds.UUID globalPreviousSnapshotID = 9;
optional string snapshotPath = 10;
optional string checkpointDir = 11 [deprecated = true];
optional int64 dbTxSequenceNumber = 12;
optional int64 dbTxSequenceNumber = 12 [deprecated = true];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be safe to just remove this field later, so that when SnapshotInfo is serialized again this field will be ignored while maintaining compatibility, as long as we don't use field number 12 ever again for this message.

optional bool deepClean = 13;
optional bool sstFiltered = 14;
// snapshot reference size before any key replication or EC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class OmSnapshotLocalData implements WithChecksum<OmSnapshotLocalData> {
// Stores the transactionInfo corresponding to OM when the snaphot is purged.
private TransactionInfo transactionInfo;

// Stores the rocksDB's transaction sequence number at the time of snapshot creation.
private long dbTxSequenceNumber;

// Map of version to VersionMeta, using linkedHashMap since the order of the map needs to be deterministic for
// checksum computation.
private final LinkedHashMap<Integer, VersionMeta> versionSstFileInfos;
Expand All @@ -78,7 +81,7 @@ public class OmSnapshotLocalData implements WithChecksum<OmSnapshotLocalData> {
* Creates a OmSnapshotLocalData object with default values.
*/
public OmSnapshotLocalData(UUID snapshotId, List<LiveFileMetaData> notDefraggedSSTFileList, UUID previousSnapshotId,
TransactionInfo transactionInfo) {
TransactionInfo transactionInfo, long dbTxSequenceNumber) {
this.snapshotId = snapshotId;
this.isSSTFiltered = false;
this.lastDefragTime = 0L;
Expand All @@ -89,9 +92,14 @@ public OmSnapshotLocalData(UUID snapshotId, List<LiveFileMetaData> notDefraggedS
this.version = 0;
this.previousSnapshotId = previousSnapshotId;
this.transactionInfo = transactionInfo;
this.dbTxSequenceNumber = dbTxSequenceNumber;
setChecksumTo0ByteArray();
}

public long getDbTxSequenceNumber() {
return dbTxSequenceNumber;
}

/**
* Copy constructor to create a deep copy of OmSnapshotLocalData object.
* @param source The source OmSnapshotLocalData to copy from
Expand All @@ -108,6 +116,7 @@ public OmSnapshotLocalData(OmSnapshotLocalData source) {
this.versionSstFileInfos = new LinkedHashMap<>();
setVersionSstFileInfos(source.versionSstFileInfos);
this.transactionInfo = source.transactionInfo;
this.dbTxSequenceNumber = source.dbTxSequenceNumber;
}

public TransactionInfo getTransactionInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ public Object construct(Node node) {
final String prevSnapIdStr = (String) nodes.get(OzoneConsts.OM_SLD_PREV_SNAP_ID);
UUID prevSnapId = prevSnapIdStr != null ? UUID.fromString(prevSnapIdStr) : null;
final String purgeTxInfoStr = (String) nodes.get(OzoneConsts.OM_SLD_TXN_INFO);
final long dbTxnSeqNumber = ((Number)nodes.get(OzoneConsts.OM_SLD_DB_TXN_SEQ_NUMBER)).longValue();
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential NullPointerException when reading existing YAML files that don't have the 'dbTxSequenceNumber' field. The code assumes the field exists and directly calls .longValue() without null-checking. Consider using getOrDefault() with a default value of 0L, similar to how 'lastDefragTime' is handled on lines 188-195.

Suggested change
final long dbTxnSeqNumber = ((Number)nodes.get(OzoneConsts.OM_SLD_DB_TXN_SEQ_NUMBER)).longValue();
Object dbTxnSeqNumberObj = nodes.getOrDefault(OzoneConsts.OM_SLD_DB_TXN_SEQ_NUMBER, 0L);
long dbTxnSeqNumber;
if (dbTxnSeqNumberObj instanceof Number) {
dbTxnSeqNumber = ((Number) dbTxnSeqNumberObj).longValue();
} else {
throw new IllegalArgumentException("Invalid type for dbTxSequenceNumber: " +
dbTxnSeqNumberObj.getClass().getName() + ". Expected Number type.");
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should never happen

TransactionInfo transactionInfo = purgeTxInfoStr != null ? TransactionInfo.valueOf(purgeTxInfoStr) : null;
OmSnapshotLocalData snapshotLocalData = new OmSnapshotLocalData(snapId, Collections.emptyList(), prevSnapId,
transactionInfo);
transactionInfo, dbTxnSeqNumber);

// Set version from YAML
Integer version = (Integer) nodes.get(OzoneConsts.OM_SLD_VERSION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.hadoop.hdds.client.DefaultReplicationConfig;
import org.apache.hadoop.hdds.client.ReplicationConfig;
import org.apache.hadoop.hdds.utils.TransactionInfo;
import org.apache.hadoop.hdds.utils.db.RDBStore;
import org.apache.hadoop.hdds.utils.db.cache.CacheKey;
import org.apache.hadoop.hdds.utils.db.cache.CacheValue;
import org.apache.hadoop.ozone.OmUtils;
Expand Down Expand Up @@ -167,12 +166,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
throw new OMException("Snapshot already exists", FILE_ALREADY_EXISTS);
}

// Note down RDB latest transaction sequence number, which is used
// as snapshot generation in the Differ.
final long dbLatestSequenceNumber =
((RDBStore) omMetadataManager.getStore()).getDb()
.getLatestSequenceNumber();
snapshotInfo.setDbTxSequenceNumber(dbLatestSequenceNumber);
ByteString txnBytes = TransactionInfo.valueOf(context.getTermIndex()).toByteString();
snapshotInfo.setCreateTransactionInfo(txnBytes);
snapshotInfo.setLastTransactionInfo(txnBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,14 @@ public String getSnapshotLocalPropertyYamlPath(UUID snapshotId) {
public void createNewOmSnapshotLocalDataFile(RDBStore snapshotStore, SnapshotInfo snapshotInfo) throws IOException {
try (WritableOmSnapshotLocalDataProvider snapshotLocalData =
new WritableOmSnapshotLocalDataProvider(snapshotInfo.getSnapshotId(),
() -> Pair.of(new OmSnapshotLocalData(snapshotInfo.getSnapshotId(),
getLiveSSTFilesForCFs(snapshotStore.getDb().getManagedRocksDb(),
COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT),
snapshotInfo.getPathPreviousSnapshotId(), null),
null))) {
() -> {
List<LiveFileMetaData> lfms = getLiveSSTFilesForCFs(snapshotStore.getDb().getManagedRocksDb(),
COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT);
long dbTxnSeqNumber = lfms.stream().mapToLong(LiveFileMetaData::largestSeqno).max().orElse(0L);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want to fall back to the dbTxSeqNumber stored in SnapshotInfo proto?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this should be ok. We are basically talking about acquiring an empty rocksdb if there are no sst files for the tables.

OmSnapshotLocalData localData = new OmSnapshotLocalData(snapshotInfo.getSnapshotId(),
lfms, snapshotInfo.getPathPreviousSnapshotId(), null, dbTxnSeqNumber);
return Pair.of(localData, null);
})) {
snapshotLocalData.commit();
}
}
Expand Down Expand Up @@ -263,16 +266,18 @@ private void addMissingSnapshotYamlFiles(
// Create a yaml file for snapshots which are missing
if (!snapshotLocalDataFile.exists()) {
List<LiveFileMetaData> sstList = Collections.emptyList();
long dbTxnSeqNumber = 0L;
if (snapshotInfo.getSnapshotStatus() == SNAPSHOT_ACTIVE) {
try (OmMetadataManagerImpl snapshotMetadataManager = defaultSnapProvider.apply(snapshotInfo)) {
ManagedRocksDB snapDB = ((RDBStore)snapshotMetadataManager.getStore()).getDb().getManagedRocksDb();
sstList = getLiveSSTFilesForCFs(snapDB, COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT);
dbTxnSeqNumber = sstList.stream().mapToLong(LiveFileMetaData::largestSeqno).max().orElse(0L);
} catch (Exception e) {
throw new IOException(e);
}
}
OmSnapshotLocalData snapshotLocalData = new OmSnapshotLocalData(snapshotId, sstList,
snapshotInfo.getPathPreviousSnapshotId(), null);
snapshotInfo.getPathPreviousSnapshotId(), null, dbTxnSeqNumber);
// Set needsDefrag to true to indicate that the snapshot needs to be defragmented, since the snapshot has
// never been defragmented before.
snapshotLocalData.setNeedsDefrag(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public Optional<Map<Path, Pair<Path, SstFileInfo>>> computeDeltaFiles(SnapshotIn
if (differ != null) {
try (OmSnapshotLocalDataManager.ReadableOmSnapshotLocalDataProvider snapProvider =
getLocalDataProvider(toSnapshot.getSnapshotId(), fromSnapshot.getSnapshotId())) {
final DifferSnapshotInfo fromDSI = getDSIFromSI(getActiveMetadataManager(), fromSnapshot,
final DifferSnapshotInfo fromDSI = toDifferSnapshotInfo(getActiveMetadataManager(), fromSnapshot,
snapProvider.getPreviousSnapshotLocalData());
final DifferSnapshotInfo toDSI = getDSIFromSI(getActiveMetadataManager(), toSnapshot,
final DifferSnapshotInfo toDSI = toDifferSnapshotInfo(getActiveMetadataManager(), toSnapshot,
snapProvider.getSnapshotLocalData());
final Map<Integer, Integer> versionMap = snapProvider.getSnapshotLocalData().getVersionSstFileInfos().entrySet()
.stream().collect(toMap(Map.Entry::getKey, entry -> entry.getValue().getPreviousSnapshotVersion()));
Expand All @@ -98,10 +98,10 @@ public Optional<Map<Path, Pair<Path, SstFileInfo>>> computeDeltaFiles(SnapshotIn
/**
* Convert from SnapshotInfo to DifferSnapshotInfo.
*/
private static DifferSnapshotInfo getDSIFromSI(OMMetadataManager activeOmMetadataManager,
private static DifferSnapshotInfo toDifferSnapshotInfo(OMMetadataManager activeOmMetadataManager,
SnapshotInfo snapshotInfo, OmSnapshotLocalData snapshotLocalData) throws IOException {
final UUID snapshotId = snapshotInfo.getSnapshotId();
final long dbTxSequenceNumber = snapshotInfo.getDbTxSequenceNumber();
final long dbTxSequenceNumber = snapshotLocalData.getDbTxSequenceNumber();
NavigableMap<Integer, List<SstFileInfo>> versionSstFiles = snapshotLocalData.getVersionSstFileInfos().entrySet()
.stream().collect(toMap(Map.Entry::getKey,
entry -> entry.getValue().getSstFiles(), (u, v) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private Pair<File, UUID> writeToYaml(UUID snapshotId, String snapshotName, Trans
createLiveFileMetaData("sst2", "table1", "k3", "k4"),
createLiveFileMetaData("sst3", "table2", "k4", "k5"));
OmSnapshotLocalData dataYaml = new OmSnapshotLocalData(snapshotId, notDefraggedSSTFileList,
previousSnapshotId, transactionInfo);
previousSnapshotId, transactionInfo, 10);

// Set version
dataYaml.setVersion(42);
Expand Down Expand Up @@ -164,6 +164,7 @@ public void testWriteToYaml() throws IOException {

// Verify fields
assertEquals(44, snapshotData.getVersion());
assertEquals(10, snapshotData.getDbTxSequenceNumber());
assertTrue(snapshotData.getSstFiltered());
assertEquals(transactionInfo, snapshotData.getTransactionInfo());

Expand Down
Loading
Loading