mirror of
https://github.com/apache/lucene.git
synced 2025-02-22 18:27:21 +00:00
SOLR-3911: sync properties files after write so that they are written out before the directory is closed.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1418789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6a11fd8db6
commit
452a32f314
@ -110,6 +110,8 @@ import org.slf4j.LoggerFactory;
|
||||
* @since solr 1.4
|
||||
*/
|
||||
public class SnapPuller {
|
||||
private static final String INDEX_PEROPERTIES = "index.peroperties";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SnapPuller.class.getName());
|
||||
|
||||
private final String masterUrl;
|
||||
@ -570,6 +572,7 @@ public class SnapPuller {
|
||||
OutputStream outFile = new PropertiesOutputStream(out);
|
||||
try {
|
||||
props.store(outFile, "Replication details");
|
||||
dir.sync(Collections.singleton(REPLICATION_PROPERTIES));
|
||||
} finally {
|
||||
IOUtils.closeQuietly(outFile);
|
||||
}
|
||||
@ -863,6 +866,7 @@ public class SnapPuller {
|
||||
try {
|
||||
os = new PropertiesOutputStream(out);
|
||||
p.store(os, "index properties");
|
||||
dir.sync(Collections.singleton(INDEX_PEROPERTIES));
|
||||
} catch (Exception e) {
|
||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
|
||||
"Unable to write index.properties", e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user