You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Riza Suminto (Code Review)" <ge...@cloudera.org> on 2021/11/16 18:28:42 UTC

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

Riza Suminto has uploaded this change for review. ( http://gerrit.cloudera.org:8080/18031


Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................

IMPALA-11020: Reattach STDOUT/STDERR independently.

IMPALA-5256 made an incorrect assumption that glog will rotate both INFO
and ERROR logs at the same time. A race condition can happen between
glog's log rotation and symlink resolutions in AttachStdoutStderrLocked
because impala does not hold glog's log_mutex.

This patch fixes the issue by replacing the DCHECK with a log, warning
if only one symlink has changed. We then reattach the stream only for
the one pointing to a new file. The next AttachStdoutStderr call after
logbufsecs will handle redirection for the slower log rotation. This
patch also adds explicit log flush after logging statements that intent
to initialize a new log file.

Testing:
- Pass the exhaustive test.

Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
---
M be/src/common/logging.cc
1 file changed, 28 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/31/18031/1
-- 
To view, visit http://gerrit.cloudera.org:8080/18031
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18031 )

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................

IMPALA-11020: Reattach STDOUT/STDERR independently.

IMPALA-5256 made an incorrect assumption that glog will rotate both INFO
and ERROR logs at the same time. A race condition can happen between
glog's log rotation and symlink resolutions in AttachStdoutStderrLocked
because impala does not hold glog's log_mutex.

This patch fixes the issue by replacing the DCHECK with a log, warning
if only one symlink has changed. We then reattach the stream only for
the one pointing to a new file. The next AttachStdoutStderr call after
logbufsecs will handle redirection for the slower log rotation. This
patch also adds explicit log flush after logging statements that intent
to initialize a new log file.

Testing:
- Pass the exhaustive test.

Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Reviewed-on: http://gerrit.cloudera.org:8080/18031
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/src/common/logging.cc
1 file changed, 28 insertions(+), 14 deletions(-)

Approvals:
  Joe McDonnell: Looks good to me, approved
  Impala Public Jenkins: Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 2
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/18031 )

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/7645/ DRY_RUN=false


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Wed, 17 Nov 2021 00:55:28 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

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

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

Thanks for the fix!

http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc
File be/src/common/logging.cc:

http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc@204
PS1, Line 204:     google::FlushLogFiles(google::GLOG_INFO);
> This will flush all log files with severity GLOG_INFO or higher
Great, good to know



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Wed, 17 Nov 2021 00:25:15 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

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

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1:

(2 comments)

This looks good, one small question.

http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc
File be/src/common/logging.cc:

http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc@204
PS1, Line 204:     google::FlushLogFiles(google::GLOG_INFO);
Should we add a flush for ERROR as well?


http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc@249
PS1, Line 249:   google::FlushLogFiles(google::GLOG_INFO);
Should we add a flush for ERROR as well?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Tue, 16 Nov 2021 23:36:59 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

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

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1:

Hello Andrew & Joe,
This is the patch needed to fix IMPALA-11020.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Tue, 16 Nov 2021 18:30:36 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/18031 )

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Wed, 17 Nov 2021 07:10:14 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/18031 )

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/9789/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Tue, 16 Nov 2021 18:51:52 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11020: Reattach STDOUT/STDERR independently.

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

Change subject: IMPALA-11020: Reattach STDOUT/STDERR independently.
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc
File be/src/common/logging.cc:

http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc@204
PS1, Line 204:     google::FlushLogFiles(google::GLOG_INFO);
> Should we add a flush for ERROR as well?
This will flush all log files with severity GLOG_INFO or higher
https://github.com/google/glog/blob/b79e18b/src/logging.cc#L653-L663

And GLOG_INFO is the lowest severity
https://github.com/google/glog/blob/b79e18b/src/glog/log_severity.h#L62

So, basically means flush all.


http://gerrit.cloudera.org:8080/#/c/18031/1/be/src/common/logging.cc@249
PS1, Line 249:   google::FlushLogFiles(google::GLOG_INFO);
> Should we add a flush for ERROR as well?
This is also will flush all log files.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I35bbed631773bf7a4d55b2b77df1a093f34dedc5
Gerrit-Change-Number: 18031
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <ri...@cloudera.com>
Gerrit-Reviewer: Andrew Sherman <as...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <ri...@cloudera.com>
Gerrit-Comment-Date: Wed, 17 Nov 2021 00:07:43 +0000
Gerrit-HasComments: Yes