vinayakphegde commented on code in PR #7239:
URL: https://github.com/apache/hbase/pull/7239#discussion_r2299922927
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java:
##########
@@ -1014,6 +1015,15 @@ private void deleteAllBackupWALFiles(Configuration conf,
String backupWalDir)
System.out.println("Deleted all contents under WAL directory: " +
walDir);
}
+ // Delete contents under bulk load directory
+ if (fs.exists(bulkloadDir)) {
+ FileStatus[] bulkContents = fs.listStatus(bulkloadDir);
+ for (FileStatus item : bulkContents) {
+ fs.delete(item.getPath(), true); // recursive delete of each child
+ }
+ System.out.println("Deleted all contents under Bulk Load directory:
" + bulkloadDir);
Review Comment:
One clarification from my side:
Our current backup directory structure looks like this:
```
-- wal_backup_directory/
-- WALs/
-- 23-08-2025/
... wal files
-- 24-08-2025/
-- 25-08-2025/
-- bulk-load-files/
-- 23-08-2025/
... bulkload files
-- 24-08-2025/
-- 25-08-2025/
```
As you can see, when we loop and delete, it’s done at the **day-wise
directory level**, not at the individual file level. So the number of delete
operations is relatively small.
Regarding re-creation: when we **enable a replication peer**, there isn’t
any placeholder mechanism to re-create this directory structure. In the
enable/disable flow, everything remains running, the only difference is that
replication is paused and then resumed. Once enabled again, entries are sent to
the replication endpoint directly.
It’s only during a **restart** that things are different. On restart, we
instantiate the `ContinuousBackupReplicationEndpoint` again, and in its
constructor we can re-create the directory structure if it’s missing. With
enable/disable, this re-creation step isn’t possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]