[
https://issues.apache.org/jira/browse/GEODE-3801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16215874#comment-16215874
]
ASF GitHub Bot commented on GEODE-3801:
---------------------------------------
jdeppe-pivotal commented on a change in pull request #963: GEODE-3801: Use
hardlinks for backup oplog files
URL: https://github.com/apache/geode/pull/963#discussion_r146398127
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/BackupManager.java
##########
@@ -569,6 +570,28 @@ private void createBackupDir(File backupDir) throws
IOException {
}
}
+ private void backupOplog(File targetDir, Oplog oplog) throws IOException {
+ File crfFile = oplog.getCrfFile();
+ backupFile(targetDir, crfFile);
+
+ File drfFile = oplog.getDrfFile();
+ backupFile(targetDir, drfFile);
+
+ oplog.finishKrf();
+ File krfFile = oplog.getKrfFile();
+ backupFile(targetDir, krfFile);
+ }
+
+ private void backupFile(File targetDir, File file) throws IOException {
+ if (file != null && file.exists())
+ try {
+ Files.createLink(targetDir.toPath().resolve(file.getName()),
file.toPath());
Review comment:
Is there any reason you cannot use a symbolic link here? That way it would
allow the link to span filesystems too.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Utilize hard-links to copy files during backups
> -----------------------------------------------
>
> Key: GEODE-3801
> URL: https://issues.apache.org/jira/browse/GEODE-3801
> Project: Geode
> Issue Type: Sub-task
> Components: persistence
> Reporter: Nick Reich
> Assignee: Nick Reich
>
> Instead of copying files which are read-only during a backup, create a
> hard-link to the file in the backup location. This prevents losing the file
> if the original location is deleted, but does not require make a new copy of
> the file. If hard-links cannot be created, revert to the existing copying
> mechanic.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)