summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-06-25 20:50:37 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 11:18:46 -0400
commitf1e8fb2466468f6a3d8508de536fbb5a2760b411 (patch)
tree3ee269405f1454837ac1229906d0fda5bf2062b5
parenta73edef9c693bb2fd29ba2b13a7a52b81afbed95 (diff)
make _ensure_full_commit a no-op in cluster interface
-rw-r--r--src/chttpd_db.erl25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 0317aed4..211eed2d 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -211,31 +211,10 @@ db_req(#httpd{method='POST',path_parts=[DbName], user_ctx=Ctx}=Req, Db) ->
db_req(#httpd{path_parts=[_DbName]}=Req, _Db) ->
send_method_not_allowed(Req, "DELETE,GET,HEAD,POST");
-db_req(#httpd{method='POST',path_parts=[_,<<"_ensure_full_commit">>]}=Req, Db) ->
- UpdateSeq = ?COUCH:get_update_seq(Db),
- CommittedSeq = ?COUCH:get_committed_update_seq(Db),
- {ok, StartTime} =
- case chttpd:qs_value(Req, "seq") of
- undefined ->
- committed = couch_batch_save:commit_now(Db#db.name, Db#db.user_ctx),
- ?COUCH:ensure_full_commit(Db);
- RequiredStr ->
- RequiredSeq = list_to_integer(RequiredStr),
- if RequiredSeq > UpdateSeq ->
- throw({bad_request,
- "can't do a full commit ahead of current update_seq"});
- RequiredSeq > CommittedSeq ->
- % user asked for an explicit sequence, don't commit any batches
- ?COUCH:ensure_full_commit(Db);
- true ->
- %% hack to make sure we always get cluster max time - APK
- ?COUCH:ensure_full_commit(Db)
- % {ok, Db#db.instance_start_time}
- end
- end,
+db_req(#httpd{method='POST',path_parts=[_,<<"_ensure_full_commit">>]}=Req, _Db) ->
send_json(Req, 201, {[
{ok, true},
- {instance_start_time, StartTime}
+ {instance_start_time, <<"0">>}
]});
db_req(#httpd{path_parts=[_,<<"_ensure_full_commit">>]}=Req, _Db) ->