Skip to content
Open
Changes from all commits
Commits
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 @@ -28,13 +28,17 @@
import org.apache.jute.BinaryOutputArchive;
import org.apache.jute.InputArchive;
import org.apache.jute.OutputArchive;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Coordinate the backup status among processes local to a server;
* coordination across servers is better served via either an extension
* to the ZAB protocol or by some external mechanism.
*/
public class BackupStatus {
private static final Logger LOG = LoggerFactory.getLogger(BackupStatus.class);

/**
* The name for the backup status file.
*/
Expand Down Expand Up @@ -133,8 +137,12 @@ public synchronized void update(long logZxid, long snapZxid) throws IOException
}

if (!statusFile.exists()) {
System.out.println("Creating file " + statusFile.getAbsolutePath());
LOG.info("BackupStatus::update(): Creating statusFile " + statusFile.getAbsolutePath());
statusFile.createNewFile();
statusFile.setReadable(true, false);
// TODO: potentially insecure. making this writable might make this vulnerable to tampering
// TODO: but file lock file needs to be worldwide-writable
statusFile.setWritable(true, false);
}

FileOutputStream os = null;
Expand Down