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

ReadEntryCallback in ReadLedgerEntriesCmd shouldn't release buffer. #1736

Merged
merged 1 commit into from Oct 9, 2018

Conversation

reddycharan
Copy link
Contributor

Descriptions of the changes in this PR:

  • ReadEntryCallback in ReadLedgerEntriesCmd shouldn't release buffer,
    which is not owned by the callback.

Motivation

with the following change, Per channel bookie clients owns the buffer for read responses. So it is not correct for ReadEntryCallback in ReadLedgerEntriesCmd to release buffer
8d048ab#diff-e50ee2c1aec1539ea185a94605b0e550R1611

because of this issue I'm seeing following error with ReadLedgerEntriesCmd

/Workspace/SFStorage/bookkeeper/bookkeeper-server/bin$ ./bookkeeper shell -localbookie readledger -bookie ****  -ledgerid 00000000-0000-0000-0000-000000000003 -firstentryid 1 -lastentryid 3
JAVA_HOME not set, using java from PATH. (/usr/bin/java)

--------- Lid=00000000-0000-0000-0000-000000000003, Eid=1 ---------
18:32:03,724 ERROR Unexpected throwable caught 
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$ReadCompletion.handleV3Response(PerChannelBookieClient.java:1699) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$3.safeRun(PerChannelBookieClient.java:1286) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-common-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.22.Final.jar:4.1.22.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

--------- Lid=00000000-0000-0000-0000-000000000003, Eid=2 ---------

18:32:03,733 ERROR Unexpected throwable caught 
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$ReadCompletion.handleV3Response(PerChannelBookieClient.java:1699) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$3.safeRun(PerChannelBookieClient.java:1286) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-common-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.22.Final.jar:4.1.22.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

- ReadEntryCallback in ReadLedgerEntriesCmd shouldn't release buffer,
which is not owned by the callback.
@reddycharan
Copy link
Contributor Author

@ivankelly related to your change 8d048ab

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch
+1
Please cherry pick to branch-4.8
#shipit

@sijie
Copy link
Member

sijie commented Oct 5, 2018

run integration tests

2 similar comments
@sijie
Copy link
Member

sijie commented Oct 5, 2018

run integration tests

@sijie
Copy link
Member

sijie commented Oct 5, 2018

run integration tests

@sijie
Copy link
Member

sijie commented Oct 5, 2018

run integration tests

1 similar comment
@sijie
Copy link
Member

sijie commented Oct 6, 2018

run integration tests

@sijie sijie merged commit 5fe5a62 into apache:master Oct 9, 2018
sijie pushed a commit that referenced this pull request Oct 9, 2018
Descriptions of the changes in this PR:

- ReadEntryCallback in ReadLedgerEntriesCmd shouldn't release buffer,
which is not owned by the callback.

### Motivation

with the following change, Per channel bookie clients owns the buffer for read responses. So it is not correct for ReadEntryCallback in ReadLedgerEntriesCmd to release buffer
8d048ab#diff-e50ee2c1aec1539ea185a94605b0e550R1611

because of this issue I'm seeing following error with ReadLedgerEntriesCmd
```
/Workspace/SFStorage/bookkeeper/bookkeeper-server/bin$ ./bookkeeper shell -localbookie readledger -bookie ****  -ledgerid 00000000-0000-0000-0000-000000000003 -firstentryid 1 -lastentryid 3
JAVA_HOME not set, using java from PATH. (/usr/bin/java)

--------- Lid=00000000-0000-0000-0000-000000000003, Eid=1 ---------
18:32:03,724 ERROR Unexpected throwable caught
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$ReadCompletion.handleV3Response(PerChannelBookieClient.java:1699) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$3.safeRun(PerChannelBookieClient.java:1286) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-common-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.22.Final.jar:4.1.22.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

--------- Lid=00000000-0000-0000-0000-000000000003, Eid=2 ---------

18:32:03,733 ERROR Unexpected throwable caught
io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release0(AbstractReferenceCountedByteBuf.java:100) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:84) ~[netty-all-4.1.22.Final.jar:4.1.22.Final]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$ReadCompletion.handleV3Response(PerChannelBookieClient.java:1699) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.proto.PerChannelBookieClient$3.safeRun(PerChannelBookieClient.java:1286) ~[bookkeeper-server-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-common-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.22.Final.jar:4.1.22.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
```

Author: cguttapalem <cguttapalem@salesforce.com>

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

This closes #1736 from reddycharan/readledgerfix

(cherry picked from commit 5fe5a62)

Signed-off-by: Sijie Guo <sijie@apache.org>

Signed-off-by: Sijie Guo <sijie@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants