Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Remove the delayed_write option #30

Merged
merged 1 commit into from

2 participants

@rzezeski

Don't use the delayed_write option when opening a file. This option
is known to cause corruption issues in Erlang 15x. It is fixed in
16B01 but currently Riak must run on 15B01, thus the VM cannot simply
be upgraded.

This patch is being made in direct relation to a customer having
buffer corruption issues when the machine is under heavy load. I was
able to reproduce easily using an underpowered centos VM running on
virtual box.

@rzezeski rzezeski Remove the delayed_write option
Don't use the delayed_write option when opening a file.  This option
is known to cause corruption issues in Erlang 15x.  It is fixed in
16B01 but currently Riak must run on 15B01, thus the VM cannot simply
be upgraded.

This patch is being made in direct relation to a customer having
buffer corruption issues when the machine is under heavy load.  I was
able to reproduce easily using an underpowered centos VM running on
virtual box.
4cb9a4d
@jonmeredith
Owner

+1 merge.

@rzezeski rzezeski merged commit babff20 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 3, 2013
  1. @rzezeski

    Remove the delayed_write option

    rzezeski authored
    Don't use the delayed_write option when opening a file.  This option
    is known to cause corruption issues in Erlang 15x.  It is fixed in
    16B01 but currently Riak must run on 15B01, thus the VM cannot simply
    be upgraded.
    
    This patch is being made in direct relation to a customer having
    buffer corruption issues when the machine is under heavy load.  I was
    able to reproduce easily using an underpowered centos VM running on
    virtual box.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 8 deletions.
  1. +1 −5 src/mi_buffer.erl
  2. +1 −3 src/mi_segment_writer.erl
View
6 src/mi_buffer.erl
@@ -51,11 +51,7 @@
new(Filename) ->
%% Open the existing buffer file...
filelib:ensure_dir(Filename),
- {ok, DelayedWriteSize} = application:get_env(merge_index, buffer_delayed_write_size),
- {ok, DelayedWriteMS} = application:get_env(merge_index, buffer_delayed_write_ms),
- FuzzedWriteSize = trunc(mi_utils:fuzz(DelayedWriteSize, 0.1)),
- FuzzedWriteMS = trunc(mi_utils:fuzz(DelayedWriteMS, 0.1)),
- {ok, FH} = file:open(Filename, [read, write, raw, binary, {delayed_write, FuzzedWriteSize, FuzzedWriteMS}]),
+ {ok, FH} = file:open(Filename, [read, write, raw, binary]),
%% Read into an ets table...
Table = ets:new(buffer, [duplicate_bag, public]),
View
4 src/mi_segment_writer.erl
@@ -66,9 +66,7 @@
from_iterator(Iterator, Segment) ->
%% Open the data file...
- {ok, DelayedWriteSize} = application:get_env(merge_index, segment_delayed_write_size),
- {ok, DelayedWriteMS} = application:get_env(merge_index, segment_delayed_write_ms),
- {ok, DataFile} = file:open(mi_segment:data_file(Segment), [write, raw, binary, {delayed_write, DelayedWriteSize, DelayedWriteMS}]),
+ {ok, DataFile} = file:open(mi_segment:data_file(Segment), [write, raw, binary]),
W = #writer {
data_file=DataFile,
Something went wrong with that request. Please try again.