[
https://issues.apache.org/jira/browse/BOOKKEEPER-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13575493#comment-13575493
]
Rakesh R commented on BOOKKEEPER-49:
------------------------------------
[~mmerli] Thanks for the idea & patch. Its good point [~hustlmsp],
synchronization on 'readCompletions' will affect the throughput of normal read
operations.
- Can try using synchronizedMultimap(com.google.common.collect.Multimap) for
better synchronization.
[http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/Multimaps.html#synchronizedMultimap(com.google.common.collect.Multimap)]
- On errorOutReadKey(), its sending #readEntryComplete to all the queued
requests for that key. Instead, I think it should send only one response and
also should remove the respective element from the list. Whats your opinion?
{code}
+ synchronized (readCompletions) {
+ for (ReadCompletion readCompletion :
readCompletions.get(key)) {
+ LOG.error("Could not write request for reading entry:
" + key.entryId + " ledger-id: "
+ + key.ledgerId + " bookie: " +
channel.getRemoteAddress());
+
readCompletion.cb.readEntryComplete(BKException.Code.BookieHandleNotAvailableException,
+ key.ledgerId, key.entryId, null,
readCompletion.ctx);
{code}
> bookkeeper - parallel async read same entry of same ledger will fail
> --------------------------------------------------------------------
>
> Key: BOOKKEEPER-49
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-49
> Project: Bookkeeper
> Issue Type: Bug
> Components: bookkeeper-client
> Affects Versions: 4.0.0, 4.1.0
> Reporter: Sijie Guo
> Assignee: Sijie Guo
> Fix For: 4.3.0
>
> Attachments:
> 0001-BOOKKEEPER-49-bookkeeper-parallel-async-read-same-en.patch
>
>
> all ledgers shared a PerChannelBookieClient.
> PerChannelBookieClient put all the read requests in a
> ConcurrentHashMap<CompletionKey, ReadCompletion> map called readCompletions,
> which is indexed by CompletionKey. If two read requests have same entryId and
> same ledgerId, they have the same CompletionKey, the latter one will
> overwrite the previous one. So a read request's callback will not be invoked.
> we may need to chain the callbacks for same completion keys.
--
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