You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2017/10/04 01:39:25 UTC
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Hello David Ribeiro Alves, Todd Lipcon,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/8204
to review the following change.
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
The new unit test triggered the crash reliably, though it's probably not the
only way (or perhaps not even the best way) to trigger it.
Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
---
M src/kudu/client/client-test.cc
M src/kudu/client/scanner-internal.cc
2 files changed, 46 insertions(+), 9 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/04/8204/1
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 1
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/8204 )
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
Patch Set 1:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/client-test.cc
File src/kudu/client/client-test.cc:
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/client-test.cc@5310
PS1, Line 5310: TEST_F(ClientTest, TestSubsequentScanRequestReturnsNoData) {
can you add a comment pointing back to the bug that this is a regression test for?
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/scanner-internal.cc
File src/kudu/client/scanner-internal.cc:
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/scanner-internal.cc@556
PS1, Line 556: if (!resp_data) {
this looks reasonable on the client side. I wonder if we should also patch the server side to send an empty 'resp_data' string even in the case that it returns no rows? that way old clients talking to new servers would also avoid the crash?
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 1
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Fri, 06 Oct 2017 00:18:17 +0000
Gerrit-HasComments: Yes
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/8204 )
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
Patch Set 2:
> Patch Set 2:
>
> > Do you mind running a quick test with an old client against a new server, sending a predicate that matches nothing? Does the lack of the change in 'has_data_in_open_' in the old client cause any problem?
>
> OK, I modified samples.cc to insert some data, scan with a batch size of 0, and use a predicate that filters out everything.
> - Old client and old server: crashed.
> - New client and old server: no crash, looped over one empty batch.
> - New client and new server: no crash, looped over one empty batch.
> - Old client and new server: no crash, looped over two empty batches (the old data_in_open_ behavior leads to an extra HasMoreRows()==true).
>
> Let me know if you have any other tests in mind.
Sounds good, that was more or less what I had in mind.
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 2
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Fri, 06 Oct 2017 02:08:57 +0000
Gerrit-HasComments: No
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/8204 )
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
Patch Set 2:
> Do you mind running a quick test with an old client against a new server, sending a predicate that matches nothing? Does the lack of the change in 'has_data_in_open_' in the old client cause any problem?
OK, I modified samples.cc to insert some data, scan with a batch size of 0, and use a predicate that filters out everything.
- Old client and old server: crashed.
- New client and old server: no crash, looped over one empty batch.
- New client and new server: no crash, looped over one empty batch.
- Old client and new server: no crash, looped over two empty batches (the old data_in_open_ behavior leads to an extra HasMoreRows()==true).
Let me know if you have any other tests in mind.
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 2
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Fri, 06 Oct 2017 02:06:05 +0000
Gerrit-HasComments: No
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/8204 )
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
Patch Set 2: Code-Review+2
looks good. Do you mind running a quick test with an old client against a new server, sending a predicate that matches nothing? Does the lack of the change in 'has_data_in_open_' in the old client cause any problem?
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 2
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Fri, 06 Oct 2017 01:13:06 +0000
Gerrit-HasComments: No
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Hello David Ribeiro Alves, Kudu Jenkins, Todd Lipcon,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/8204
to look at the new patch set (#2).
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
The new unit test triggered the crash reliably, though it's probably not the
only way (or perhaps not even the best way) to trigger it.
I also modified the tserver to always populate the scan data fields so that
older clients are also protected. This necessitated an additional change to
how a scanner's "data in open" was computed: the existence of the 'data'
field in the scan response isn't enough. The Java client was already doing
this, so it seems like a reasonable change to make on the C++ side.
Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
---
M src/kudu/client/client-test.cc
M src/kudu/client/scanner-internal.cc
M src/kudu/tserver/tablet_service.cc
3 files changed, 69 insertions(+), 45 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/04/8204/2
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 2
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/8204 )
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
Patch Set 1:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/client-test.cc
File src/kudu/client/client-test.cc:
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/client-test.cc@5310
PS1, Line 5310: TEST_F(ClientTest, TestSubsequentScanRequestReturnsNoData) {
> can you add a comment pointing back to the bug that this is a regression te
Done
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/scanner-internal.cc
File src/kudu/client/scanner-internal.cc:
http://gerrit.cloudera.org:8080/#/c/8204/1/src/kudu/client/scanner-internal.cc@556
PS1, Line 556: if (!resp_data) {
> this looks reasonable on the client side. I wonder if we should also patch
Done
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 1
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Fri, 06 Oct 2017 01:07:26 +0000
Gerrit-HasComments: Yes
[kudu-CR] KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/8204 )
Change subject: KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
......................................................................
KUDU-2167: fix C++ client crash due to bad assumption regarding scan data
The new unit test triggered the crash reliably, though it's probably not the
only way (or perhaps not even the best way) to trigger it.
I also modified the tserver to always populate the scan data fields so that
older clients are also protected. This necessitated an additional change to
how a scanner's "data in open" was computed: the existence of the 'data'
field in the scan response isn't enough. The Java client was already doing
this, so it seems like a reasonable change to make on the C++ side.
Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Reviewed-on: http://gerrit.cloudera.org:8080/8204
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
---
M src/kudu/client/client-test.cc
M src/kudu/client/scanner-internal.cc
M src/kudu/tserver/tablet_service.cc
3 files changed, 69 insertions(+), 45 deletions(-)
Approvals:
Todd Lipcon: Looks good to me, approved
Kudu Jenkins: Verified
--
To view, visit http://gerrit.cloudera.org:8080/8204
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If1a8a4e22082cf39710b9f00894f644a0b34234e
Gerrit-Change-Number: 8204
Gerrit-PatchSet: 3
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>