You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Rakesh R (JIRA)" <ji...@apache.org> on 2012/06/20 13:02:42 UTC
[jira] [Created] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Rakesh R created BOOKKEEPER-304:
-----------------------------------
Summary: Prepare bookie vs ledgers cache and will be used by the Auditor
Key: BOOKKEEPER-304
URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
Project: Bookkeeper
Issue Type: Sub-task
Components: bookkeeper-server
Reporter: Rakesh R
Assignee: Rakesh R
Fix For: 4.2.0
This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: BOOKKEEPER-304.4.patch
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: BOOKKEEPER-304.2.patch
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398295#comment-13398295 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
Regarding the patch, BOOKKEEPER-203 changed the ledger managers so that references to ZooKeeper were completely removed. This was done because for some usecases, zookeeper isn't suitable for storing ledger metadata (like a cluster with 1billion ledgers).
This patch should use the new LedgerManager. I can use asyncProcessLedgers to get the list of ledger ids, and with each ID, use readLedgerMetadata to get the ensembles.
Generating this map should be quite quick (of course we should verify this statement) and given that bookie crashes should be rather rare, we can regenerate each time a bookie goes down.
I don't think watchers is a good approach here, as you will end up with as many watchers as you have ledgers, which could be millions, and in any case, when the watcher is triggered you have get the whole ledger list again anyhow. Also, watching is zk specific, so not possible through just the LedgerManager interface.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: BOOKKEEPER-304.1.patch
Attached the latest patch by including LedgerManager changes also. Could you please have a look on the design.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398408#comment-13398408 ]
Uma Maheswara Rao G commented on BOOKKEEPER-304:
------------------------------------------------
Yes, there will be a cycle. BK server will depend on auditor package to start the auditing service. Auditor Package will depend on some of BK sever exposed packages like core interface LedgerManager..etc.
To avoid this cycle, can we have some kind of ServicePlugins.
BK server lifecycle will start, stop this plugins. Presently there is only one service i.e Auditing service.
Some similar pattern from DN:
{code}
private void startPlugins(Configuration conf) {
plugins = conf.getInstances(DFS_DATANODE_PLUGINS_KEY, ServicePlugin.class);
for (ServicePlugin p: plugins) {
try {
p.start(this);
LOG.info("Started plug-in " + p);
} catch (Throwable t) {
LOG.warn("ServicePlugin " + p + " could not be started", t);
}
}
}{code}
Thoughts?
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400394#comment-13400394 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
This patch is very good. I have a couple of comments/questions.
# putLedger should be synchronized.
# import StringUtils rather than using the fully qualified name.
# In case of error, throw an exception from #getBookieToLedgerIndex. at the auditor level, this should result in the auditor giving up control. When a new auditor takes over, it should run a check between the contents of the bookie->ledger map and the current available bookies.
# It should throw a custom exception, not IOException. I've created a ReplicationException class in BOOKKEEPER-246. Perhaps you add one under that, or use the UnavailableException already defined there.
# Perhaps, instead of storing the ledgers as a List<Long>, store them as a HashSet<Long>. Storing as a list, will make putLedger very slow if there is a lot of ledgers (List#contains is O(n)).
#Why do you need the grace period in testEnsembleReformation()?
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443133#comment-13443133 ]
Sijie Guo commented on BOOKKEEPER-304:
--------------------------------------
thanks Ivan and Uma for replies. I agreed to let it first and optimize later.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442364#comment-13442364 ]
Uma Maheswara Rao G commented on BOOKKEEPER-304:
------------------------------------------------
Yeah, Thanks a lot Ivan and Rekesh for working hard on this.
Its true that with out complete synchronization we can handle like how Ivan did in this patch.
I can see, that after put again checking for the return value and setting back to older if null. That partical peice really will make that synchronization is not required. Even someone else removes it, put may retun null and restore to older value. This is what I understud from it.
+1 from me. Great efforts Rakesh and Ivan for moving this work forward.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398366#comment-13398366 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
@Flavio @Ivan
Thanks for looking the patch. I've few clarifications and please correct me if I'm wrong.
bq.is that starting the auditor would then be a separate admin task
But I got confused whether to keep the auditor service out of bookie server and hope you are considering it as an external entity used by admin.
Just my idea is, during the bookie startup only one among them in the bkcluster will play as auditor(do auditing service) and is part of the bookie server side. With this approach I feel the recovery mechanism will act quickly on failures.
Also Auditor recovery feature is a configurable item and can be switched off/on. What's your thoughts on this?
bq.This patch should use the new LedgerManager. I can use asyncProcessLedgers to get the list of ledger ids, and with each ID, use readLedgerMetadata to get the ensembles.
Yeah Ivan, I got the idea of LedgerManager generalization and will refactor the code.
{quote}.Generating this map should be quite quick (of course we should verify this statement) and given that bookie crashes should be rather rare, we can regenerate each time a bookie goes down.
I don't think watchers is a good approach here, as you will end up with as many watchers as you have ledgers, which could be millions, and in any case, when the watcher is triggered you have get the whole ledger list again anyhow. Also, watching is zk specific, so not possible through just the LedgerManager interface.
{quote}
As I understand, auditor won't maintain a bookie vs ledger index cache. On demand (failure notification) auditor will start parsing all the ledger metadata and get suspected ledgers corresponding to the failed bookie(s).
But I'm just thinking the overhead of generating the indexes each time. Will it be ok?
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442461#comment-13442461 ]
Hudson commented on BOOKKEEPER-304:
-----------------------------------
Integrated in bookkeeper-trunk #673 (See [https://builds.apache.org/job/bookkeeper-trunk/673/])
BOOKKEEPER-304: Prepare bookie vs ledgers cache and will be used by the Auditor (rakeshr via ivank) (Revision 1377703)
Result = FAILURE
ivank :
Files :
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/BookieLedgerIndexer.java
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationException.java
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/BookieLedgerIndexTest.java
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: (was: BOOKKEEPER-304.patch)
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440296#comment-13440296 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
@Ivan
Attached reworked patch addressing the comments. Could you have a look on the same.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uma Maheswara Rao G updated BOOKKEEPER-304:
-------------------------------------------
Component/s: (was: bookkeeper-server)
bookkeeper-auto-recovery
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442803#comment-13442803 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
Ah, I missed your comment as I had this queued to go once I saw one response. We can fix the tests in another JIRA. I'll open a JIRA for it tomorrow.
Regarding the memory limit, we would hit it for more than a couple of hundred million ledgers. However, I wanted to get the base case committed first, and then optimize after. I have ideas for fully distributing the auditor also, which would remove this limit, but it's not fully fleshed out yet.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436861#comment-13436861 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
Looks good. However, since we can't gaurantee that process() won't be called concurrently, you should use ConcurrentHashMap and construct the sets using Collections.synchronizedSet().
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: BOOKKEEPER-304.3.patch
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400544#comment-13400544 ]
Flavio Junqueira commented on BOOKKEEPER-304:
---------------------------------------------
About the plugin discussion, I couldn't get a sense if you folks are more inclined towards having the auditor as a separate process or not. Is there any disadvantage of running it as a separate process? If it runs as a separate process, then making it a plugin is not necessary, yes?
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400701#comment-13400701 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
This patch to be applied on top of BOOKKEEPER-272
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13432717#comment-13432717 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
{quote}
Do you not mean that BOOKKEEPER-272 should be applied on top of this? 272 uses the indexer, so is dependent on this.
{quote}
@Ivan
I've rebased the patch with latest trunk and now its completely independent. It would be great if review the patch.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivan Kelly updated BOOKKEEPER-304:
----------------------------------
Attachment: BOOKKEEPER-304.diff
[~rakeshr] ConcurrentHashMap is used incorrectly in the patch (it was also wrong in the snippet I posted in my last comment). New patch uses it correctly (i.e. when using ConcurrentHashMap, you don't need external synchronization).
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400570#comment-13400570 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
@Ivan
bq. I have a couple of comments/questions.
Thanks for your time and review comments. I have reworked the comments and just have a look.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444817#comment-13444817 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
Thanks Ivan for showing me to use 'bookie2ledgersMap.putIfAbsent(bookie, ledgers);'. Its really great and now its more readable.
Thanks Sijie,Uma for your reviews. I just raised BOOKKEEPER-384 to address the 1st and the 2nd comments
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436864#comment-13436864 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
Also, in the test you define maxInt, which is already defined here:
http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MAX_VALUE
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398391#comment-13398391 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
{quote}
Just my idea is, during the bookie startup only one among them in the bkcluster will play as auditor(do auditing service) and is part of the bookie server side. With this approach I feel the recovery mechanism will act quickly on failures.
Also Auditor recovery feature is a configurable item and can be switched off/on. What's your thoughts on this?
{quote}
My understanding of it is that the auditor will run in the bookie process but will not directly access any bookie internals. Instead it will do everything through the client API. The reason for putting it in the same process it just that it's more convenient. It could be moved to a different process if this proves problematic.
{quote}
But I'm just thinking the overhead of generating the indexes each time. Will it be ok?
{quote}
This is an open question. We'll have to run a couple of tests to verify, but to start with, it should be ok.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439326#comment-13439326 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
@Ivan
Thanks for the comments.
Point-1) yeah, I agree to use Collections.synchronizedSet() and will do the necessary changes.
Point-2) But having doubt whether to use ConcurrentHashMap or not?
Here bookie2ledgersMap.put(bookie, ledgers); is getting called inside synchronized block as follows, I couldn't see any necessity of concurrentHashMap. I'm missing anything?
I'm having double check to avoid two guys are seeing null simultaneously. Even if I'm having ConcurrentHashMap, say if two guys has come and invoked map#get() method. Both will see null one after another and continue for creating their own separate HasSet. Isn't it?
{code}
Set<Long> ledgers = bookie2ledgersMap.get(bookie);
// creates an empty list and add to bookie for keeping its ledgers
if (ledgers == null) {
synchronized (bookie2ledgersMap) {
// double check whether the ledgerset exists or not
ledgers = bookie2ledgersMap.get(bookie);
if (ledgers == null) {
edgers = new HashSet<Long>();
bookie2ledgersMap.put(bookie, ledgers);
}
}
}
{code}
Could you please give your thoughts?
Thanks
Rakesh
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (BOOKKEEPER-304) Prepare bookie vs ledgers
cache and will be used by the Auditor
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442424#comment-13442424 ]
Sijie Guo edited comment on BOOKKEEPER-304 at 8/28/12 1:02 AM:
---------------------------------------------------------------
the synchronization part looks good to me.
I had some minor comments about the patch.
1) LedgerManagerFactory and LedgerManager is construct in the tests but they aren't be closed or uninitialized. it might be not a good practice.
2)
{code}
+ List<Long> ledgerList = new ArrayList<Long>(3);
+ LedgerHandle lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
{code}
It might be better to put them in a for-loop for same code.
3) About the BookieLedgerIndexer.
3.1) Do we need to put all ledger metadata in memory? Could we do it part by part? For example, we indexed 1~K ledgers and process them. then we indexed K+1 ~ M ledgers and process them. so we don't need to process all ledger metadata in one time. It might be useful and necessary for a bookkeeper instance contains large number of ledgers.
was (Author: hustlmsp):
the synchronization part looks good to me.
I had some minor comments about the patch.
1) LedgerManagerFactory and LedgerManager is construct in the tests but they aren't be closed or uninitialized. it might be not a good practice.
2)
{code}
+ List<Long> ledgerList = new ArrayList<Long>(3);
+ LedgerHandle lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
{code}
It might be better to put them in a for-loop for same code.
3) About the BookieLedgerIndexer.
3.1) Do we need to put all ledger metadata in memory? Could we do it part by part? For example, we indexed 1~K ledgers and process them. then we indexed K+1 ~ M ledgers and process them. so we don't need to process all ledger metadata in one time. It might be useful and necessary for a bookkeeper instance contains large number of ledgers.
3.2) asyncProcessLedgers is not a good api for BookieLedgerIndexer. because asyncProcessLedgers would read LedgerMetadata from ledger manager. but BookieLedgerIndexer doesn't use LedgerMetadata at all. so it waste time on reading all ledger metadata. I would suggest to add better api in LedgerManager to fit the requirement for Auditor.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: BOOKKEEPER-304.2.patch
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397844#comment-13397844 ]
Flavio Junqueira commented on BOOKKEEPER-304:
---------------------------------------------
Not sure if this is the right place to make this comment, but I was wondering if the auditor should be a package within bookkeeper-server or a separate module. It is pretty independent of BK client and Bookie, no?
I was also wondering if we can code it in a way that does not require making methods public in the meta package.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442424#comment-13442424 ]
Sijie Guo commented on BOOKKEEPER-304:
--------------------------------------
the synchronization part looks good to me.
I had some minor comments about the patch.
1) LedgerManagerFactory and LedgerManager is construct in the tests but they aren't be closed or uninitialized. it might be not a good practice.
2)
{code}
+ List<Long> ledgerList = new ArrayList<Long>(3);
+ LedgerHandle lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
{code}
It might be better to put them in a for-loop for same code.
3) About the BookieLedgerIndexer.
3.1) Do we need to put all ledger metadata in memory? Could we do it part by part? For example, we indexed 1~K ledgers and process them. then we indexed K+1 ~ M ledgers and process them. so we don't need to process all ledger metadata in one time. It might be useful and necessary for a bookkeeper instance contains large number of ledgers.
3.2) asyncProcessLedgers is not a good api for BookieLedgerIndexer. because asyncProcessLedgers would read LedgerMetadata from ledger manager. but BookieLedgerIndexer doesn't use LedgerMetadata at all. so it waste time on reading all ledger metadata. I would suggest to add better api in LedgerManager to fit the requirement for Auditor.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442903#comment-13442903 ]
Uma Maheswara Rao G commented on BOOKKEEPER-304:
------------------------------------------------
{quote}
However, I wanted to get the base case committed first, and then optimize after.
{quote}
Completely make sense, especially when building some big features.
Also, Wanted to make a note that, we are planning to keep the auditor as separate process now right. So, it should not create issues for the BK instances. We can optimize one by one for considering this new process loads.
@Sijie, Your thought is good on memory optimizations. Yes, if you find out any such improvements in this new area of code, even its committed, please file a JIRAs under BK-237. We can attack one by one. Thanks a lot for your comments.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442793#comment-13442793 ]
Sijie Guo commented on BOOKKEEPER-304:
--------------------------------------
@Ivan, I added a comment before you committed the patch. Although you had committed it, I still would like to here the opinions from you, especially about the memory concern for a bookkeeper instance contains large number of ledgers.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch, BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated BOOKKEEPER-304:
--------------------------------
Attachment: BOOKKEEPER-304.patch
Attached initial draft version to discuss the design of the bookie vs ledger cache.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399427#comment-13399427 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
Thanks all for the comments.
@Ivan
bq.My understanding of it is that the auditor will run in the bookie process but will not directly access any bookie internals. Instead it will do everything through the client API
To start, attached the latest patch by using the ledgermanager interface. Please have a look and would like to know the approach is correct.
Hi everyone,
Still the package structure and bookie process dependency is open point. I feel, would need more discussion on this.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400732#comment-13400732 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
Do you not mean that BOOKKEEPER-272 should be applied on top of this? 272 uses the indexer, so is dependent on this.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch, BOOKKEEPER-304.2.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398287#comment-13398287 ]
Ivan Kelly commented on BOOKKEEPER-304:
---------------------------------------
The problem with putting it in a separate module, is that starting the auditor would then be a separate admin task. We couldn't start it from the bookkeeper script along with a bookie, because that would mean bookkeeper-server would have to be dependent on bookkeeper-auditor which would be dependent on bookkeeper-server.
I agree that the code should be kept as independent of bookkeeper-server as possible though.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BOOKKEEPER-304) Prepare bookie vs ledgers cache
and will be used by the Auditor
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399247#comment-13399247 ]
Rakesh R commented on BOOKKEEPER-304:
-------------------------------------
Thanks Ivan, Flavio, Uma for your reviews and suggestions.
@Ivan
{quote}
My understanding of it is that the auditor will run in the bookie process but will not directly access any bookie internals. Instead it will do everything through the client API. The reason for putting it in the same process it just that it's more convenient. It could be moved to a different process if this proves problematic.
{quote}
ok. I think I got it. As part of this jira I'll prepare the bookie-ledger indexing logic using LedgerManager interface and will keep as an independent module.
Few more clarifications:
# But the bookkeeper-server would have to start the auditing service, still this dependency has to be resolved?
# Also would like to know the suggestions on package structure?
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira