iilyak commented on a change in pull request #1370: [5/5] Clustered Purge
Implementation
URL: https://github.com/apache/couchdb/pull/1370#discussion_r198471640
##########
File path: src/mem3/src/mem3_rep.erl
##########
@@ -249,8 +248,9 @@ pull_purges(#acc{} = Acc0) ->
end,
if Remaining =< 0 -> ok; true ->
- OldestPurgeSeq = couch_db:get_oldest_purge_seq(Db),
- PurgesToPush = couch_db:get_purge_seq(Db) - OldestPurgeSeq,
+ {ok, PurgeSeq} = couch_db:get_purge_seq(Db),
Review comment:
Thank you I found it
[here](https://github.com/apache/couchdb/blob/COUCHDB-3326-clustered-purge-pr5-implementation/src/couch/src/couch_db.erl#L521)
This means that return values from couch_db are inconsistent
([POLA](https://en.wikipedia.org/wiki/Principle_of_least_astonishment)). Here
is a list of functions which deal with different sequences:
- `get_update_seq` returns `integer()`
- `get_purge_seq` returns `{ok, integer()}`
- `get_oldest_purge_seq` returns `{ok, integer()}`
- `get_compacted_seq` returns `integer()`
- `get_committed_update_seq` returns `integer()`
I think that since we are updating purge feature we should take an
opportunity to make it consistent, change return type and update all callers.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services