Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'cassandra-1.1' into cassandra-1.2

Conflicts:
	CHANGES.txt
	src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
  • Loading branch information...
commit ac1d7ee1c79897cbc867b37e712fe2d3b1ef1ea8 2 parents c007102 + fe910e6
Marcus Eriksson authored
View
2  CHANGES.txt
@@ -25,7 +25,7 @@ Merged from 1.1
* Use allocator information to improve memtable memory usage estimate
(CASSANDRA-5497)
* Fix trying to load deleted row into row cache on startup (CASSANDRA-4463)
-
+ * fsync leveled manifest to avoid corruption (CASSANDRA-5535)
1.2.4
* Ensure that PerRowSecondaryIndex updates see the most recent values
View
6 src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -18,6 +18,7 @@
package org.apache.cassandra.db.compaction;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;
@@ -586,7 +587,8 @@ public synchronized void serialize()
JsonFactory f = new JsonFactory();
try
{
- JsonGenerator g = f.createJsonGenerator(tmpFile, JsonEncoding.UTF8);
+ FileOutputStream fos = new FileOutputStream(tmpFile);
+ JsonGenerator g = f.createJsonGenerator(fos, JsonEncoding.UTF8);
g.useDefaultPrettyPrinter();
g.writeStartObject();
g.writeArrayFieldStart("generations");
@@ -603,6 +605,8 @@ public synchronized void serialize()
}
g.writeEndArray(); // for field generations
g.writeEndObject(); // write global object
+ g.flush();
+ fos.getFD().sync();
g.close();
}
catch (IOException e)
Please sign in to comment.
Something went wrong with that request. Please try again.