mirror of https://github.com/apache/cassandra
Fix a problem with static segments being opened with an empty offset after switch unless active segments offset file was closed
Patch by Alex Petrov; reviewed by Aleksey Yeschenko for CASSANDRA-19867
This commit is contained in:
parent
f1db115e73
commit
00ebcdc9f2
|
|
@ -183,6 +183,7 @@ final class ActiveSegment<K, V> extends Segment<K, V>
|
|||
{
|
||||
index.persist(descriptor);
|
||||
metadata.persist(descriptor);
|
||||
syncedOffsets.fsync();
|
||||
SyncUtil.trySyncDir(descriptor.directory);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ interface SyncedOffsets extends Closeable
|
|||
{
|
||||
output.writeInt(offset);
|
||||
output.writeInt((int) crc.getValue());
|
||||
output.flush();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue