Permalink
Browse files

MB-10138: Writing a header now also returns the position

The function to write a header now also returns the position. This change
was introduce in commit /79038773b2ed4beaa1e1bf2e889fcff4141ff49e [1][2].

This fixes the testrunner spatialquery.conf tests (tested on single
and 4 nodes).

[1] couchbase/couchdb@7903877
[2] http://review.couchbase.org/28816

Change-Id: Ied2f89ff72990e1f93e5eb7cbe91338684e9e06f
Reviewed-on: http://review.couchbase.org/33284
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
  • Loading branch information...
1 parent a8ba56c commit 6c3319dcc2120b4c35de96360cf1b36d07b18084 @vmx vmx committed Feb 6, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/geocouch/couch_spatial_group.erl
@@ -267,7 +267,7 @@ handle_info(delayed_commit, #group_state{db_name=DbName,group=Group}=State) ->
if CommittedSeq >= Group#spatial_group.current_seq ->
% save the header
Header = {Group#spatial_group.sig, get_index_header_data(Group)},
- ok = couch_file:write_header(Group#spatial_group.fd, Header),
+ {ok, _Pos} = 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 ->
@@ -536,7 +536,7 @@ reset_group(#spatial_group{indexes=Indexes}=Group) ->
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, 0} = couch_file:write_header(Fd, {Sig, nil}),
ok = couch_file:flush(Fd),
init_group(Db, Fd, reset_group(Group), nil).

0 comments on commit 6c3319d

Please sign in to comment.