From f1e8fb2466468f6a3d8508de536fbb5a2760b411 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 25 Jun 2010 20:50:37 -0400 Subject: make _ensure_full_commit a no-op in cluster interface --- src/chttpd_db.erl | 25 ++----------------------- 1 file 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) -> -- cgit v1.2.3