Permalink
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...
2 parents c007102 + fe910e6 commit ac1d7ee1c79897cbc867b37e712fe2d3b1ef1ea8 Marcus Eriksson committed May 4, 2013
Showing with 6 additions and 2 deletions.
  1. +1 −1 CHANGES.txt
  2. +5 −1 src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
View
@@ -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
@@ -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)

0 comments on commit ac1d7ee

Please sign in to comment.