Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Headers weren't flushed

In Couchbase you need to flush manually. The couch_file:flush/1
where missing after writing the header.

Change-Id: I111c4d797ab8155187ff095a1e8a32016ca87039
Reviewed-on: http://review.couchbase.org/12350
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
  • Loading branch information...
commit 299e94cc86ce244c9dd60f97613e5acdd9a2ff2e 1 parent 8cae642
@vmx vmx authored vmx committed
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/geocouch/couch_spatial_group.erl
View
2  src/geocouch/couch_spatial_group.erl
@@ -255,6 +255,7 @@ handle_info(delayed_commit, #group_state{db_name=DbName,group=Group}=State) ->
% save the header
Header = {Group#spatial_group.sig, get_index_header_data(Group)},
ok = couch_file:write_header(Group#spatial_group.fd, Header),
+ ok = couch_file:flush(Group#spatial_group.fd),
{noreply, State#group_state{waiting_commit=false}};
true ->
% We can't commit the header because the database seq that's fully
@@ -509,6 +510,7 @@ reset_file(Db, Fd, DbName, #spatial_group{sig=Sig,name=Name} = Group) ->
?LOG_DEBUG("Resetting spatial group index \"~s\" in db ~s", [Name, DbName]),
ok = couch_file:truncate(Fd, 0),
ok = couch_file:write_header(Fd, {Sig, nil}),
+ ok = couch_file:flush(Fd),
init_group(Db, Fd, reset_group(Group), nil).
Please sign in to comment.
Something went wrong with that request. Please try again.