You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Will Berkeley (Code Review)" <ge...@cloudera.org> on 2019/02/26 21:19:57 UTC

[kudu-CR] Fix potential duplicate scanner on /scans page

Will Berkeley has uploaded this change for review. ( http://gerrit.cloudera.org:8080/12600


Change subject: Fix potential duplicate scanner on /scans page
......................................................................

Fix potential duplicate scanner on /scans page

In rare scenarios, it is possible to see the same scanner listed twice
on the /scans page. This can happen because we gather the list in two
stages, first getting a list of in-flight scanners, and then getting a
list of recently completed scanners. Each is done under a lock and so
gives a consistent snapshot of in-flight or completed scanners,
respectively, but if a scanner completes between gathering the list of
in-flight scanners and gathering the list of completed scanners, it's
possible to see that same scanner listed as both in-flight and also as
completed.

This patch changes the logic a bit so we deduplicate the list of
scanners by scanner id, favoring keeping the information about a
complete scanner since it must be more up-to-date than information
about the scanner while it was in-flight.

Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
---
M src/kudu/tserver/scanners.cc
1 file changed, 14 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/00/12600/1
-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 1
Gerrit-Owner: Will Berkeley <wd...@gmail.com>

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................

Fix potential duplicate scanner on /scans page

In rare scenarios, it is possible to see the same scanner listed twice
on the /scans page. This can happen because we gather the list in two
stages, first getting a list of in-flight scanners, and then getting a
list of recently completed scanners. Each is done under a lock and so
gives a consistent snapshot of in-flight or completed scanners,
respectively, but if a scanner completes between gathering the list of
in-flight scanners and gathering the list of completed scanners, it's
possible to see that same scanner listed as both in-flight and also as
completed.

This patch changes the logic a bit so we deduplicate the list of
scanners by scanner id, favoring keeping the information about a
complete scanner since it must be more up-to-date than information
about the scanner while it was in-flight.

Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Reviewed-on: http://gerrit.cloudera.org:8080/12600
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Tested-by: Will Berkeley <wd...@gmail.com>
---
M src/kudu/tserver/scanners.cc
1 file changed, 16 insertions(+), 8 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Alexey Serbin: Looks good to me, approved
  Will Berkeley: Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 3
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Patch Set 2: Verified+1

Unrelated, possibly new flake in OptionalSSL/TestRpc.TestClientConnectionMetrics/0


-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 2
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 26 Feb 2019 23:33:24 +0000
Gerrit-HasComments: No

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc@224
PS1, Line 224:   std::unordered_map<string, ScanDescriptor> scans;
Nit: using for this



-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 1
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 26 Feb 2019 22:14:14 +0000
Gerrit-HasComments: Yes

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has removed a vote on this change.

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 2
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Patch Set 2: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 2
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 26 Feb 2019 22:24:12 +0000
Gerrit-HasComments: No

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/12600

to look at the new patch set (#2).

Change subject: Fix potential duplicate scanner on /scans page
......................................................................

Fix potential duplicate scanner on /scans page

In rare scenarios, it is possible to see the same scanner listed twice
on the /scans page. This can happen because we gather the list in two
stages, first getting a list of in-flight scanners, and then getting a
list of recently completed scanners. Each is done under a lock and so
gives a consistent snapshot of in-flight or completed scanners,
respectively, but if a scanner completes between gathering the list of
in-flight scanners and gathering the list of completed scanners, it's
possible to see that same scanner listed as both in-flight and also as
completed.

This patch changes the logic a bit so we deduplicate the list of
scanners by scanner id, favoring keeping the information about a
complete scanner since it must be more up-to-date than information
about the scanner while it was in-flight.

Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
---
M src/kudu/tserver/scanners.cc
1 file changed, 16 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/00/12600/2
-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 2
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Patch Set 2: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 2
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 26 Feb 2019 22:29:21 +0000
Gerrit-HasComments: No

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc@246
PS1, Line 246:   vector<ScanDescriptor> ret;
             :   AppendValuesFromMap(scans, &ret);
nit: maybe, add

ret.reserve(scans.size());

?



-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 1
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 26 Feb 2019 21:32:17 +0000
Gerrit-HasComments: Yes

[kudu-CR] Fix potential duplicate scanner on /scans page

Posted by "Will Berkeley (Code Review)" <ge...@cloudera.org>.
Will Berkeley has posted comments on this change. ( http://gerrit.cloudera.org:8080/12600 )

Change subject: Fix potential duplicate scanner on /scans page
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc@224
PS1, Line 224:   std::unordered_map<string, ScanDescriptor> scans;
> Nit: using for this
Done


http://gerrit.cloudera.org:8080/#/c/12600/1/src/kudu/tserver/scanners.cc@246
PS1, Line 246:   vector<ScanDescriptor> ret;
             :   AppendValuesFromMap(scans, &ret);
> nit: maybe, add
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/12600
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I680546d80315a1548337a504c45afa4f2f0350ad
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 1
Gerrit-Owner: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 26 Feb 2019 22:18:47 +0000
Gerrit-HasComments: Yes