Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BP-32: Advisory (optimistic) write close #1343

Open
3 tasks
reddycharan opened this issue Apr 14, 2018 · 4 comments
Open
3 tasks

BP-32: Advisory (optimistic) write close #1343

reddycharan opened this issue Apr 14, 2018 · 4 comments

Comments

@reddycharan
Copy link
Contributor

reddycharan commented Apr 14, 2018

FEATURE REQUEST

  1. Please describe the feature you are requesting.

With #570, entrylog per ledger feature will be introduced. With this feature there will be dedicated entrylog for each ledger. < sub-task6 > of issue-570 implements EntryLogManagerForEntryLogPerLedger.

Since there is going to be entrylog per ledger, with the current Bookie implementation there is no way to know when the entrylog is writeclosed and the entrylog for the active ledger can be rotated. So in < sub-task6 > of issue-57, as a first step of handling this, expireAfterAccess (each entrylog should be automatically rotated from the current active entrylog list once a fixed duration has elapsed after the last access of entrylog for addEntry) will be implemented and also the maximum number of entrylogs that can be active at a given time (this is for limiting number of entrylogs/filedescriptors open at a given time).

The above mentioned approaches are preliminary ways of handling but it would be ideal to have explicit call to EntryLogger when the write for this ledger is done so that it can rotate the entrylog as soon as it is done writing. This will minimize the number of entrylogs/file descriptors that are open/active and also it will make progress in leastUnflushedLogId, so that GarbageCollectorThread can consider these entrylogs for garbage collection. So as part of next step, following can be done

  • have explicit write close request. This write close request should be sent to the current ensemble when the write handle is closed. This should be just optimistic write close operation and callback of this operation should be just logger, saying if it is succeeded / partially succeeded / failed. This should be done asynchronously and the write handle close operation should not be blocked for this response.

  • In the case of ledger recover open, readrequest (ReadEntryProcessorV3) with fence flag, can take care of calling appropriate methods in ledgerdescriptor / entry logger to rotate the entrylog for the ledger

  • in the case of auto-replication case, LedgerFragmentReplicator already uses bookieclient for addEntry (bkc.getBookieClient().addEntry), the same bookieClient instance can be used to call explicit writeClose method in bookieclient.

  • in the case of any write failure in bookie for an entry, then before sending error response to the client do entrylog rotation

  1. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

This is should-have feature for entrylogperledger

  1. If there are some sub-tasks using -[] for each subtask and create a corresponding issue to map to the sub task:
  • [sub-task1]: Introduce new writeclose request (proto/message) and implement the bookie server side of the write close. Integrate ReadEntryProcessorV3 readrequest with fence flag to bookie side of writeClose request.
  • [sub-task2]: client side of write handle close request, and integration of calling appropriate writeclose method of bookieclient in LedgerFragmentReplicator (replication scenario)
  • [sub-task3]: consider the optimizations of rotating entrylog in the case of any write failure in bookie for an entry before sending write error response to the client. (This needs more discussions and this is not well defined as of now)
@reddycharan
Copy link
Contributor Author

@jvrao @sijie fyi

@sijie
Copy link
Member

sijie commented Apr 24, 2018

@reddycharan do you have any proposal about writeclose request? since this is a wire protocol change, it would be good to have a BP sent out for it, before you actually implementing it. so that we can agree on what the message would look like for writeclose.

http://bookkeeper.apache.org/community/bookkeeper_proposals/

@reddycharan
Copy link
Contributor Author

@sijie will do

@reddycharan reddycharan changed the title Advisory (optimistic) write close BP-32 Advisory (optimistic) write close Apr 27, 2018
@reddycharan reddycharan changed the title BP-32 Advisory (optimistic) write close BP-32: Advisory (optimistic) write close Apr 27, 2018
sijie pushed a commit that referenced this issue May 3, 2018
Descriptions of the changes in this PR:

initial proposal for Advisory (optimisitic) write close

Master Issue: #1343

Author: cguttapalem <cguttapalem@salesforce.com>

Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <sijie@apache.org>

This closes #1374 from reddycharan/advwriteclosebp
@sijie
Copy link
Member

sijie commented Aug 18, 2019

@reddycharan are you still working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants