saintstack commented on a change in pull request #378: HBASE-22684 The log
rolling request maybe canceled immediately in Log…
URL: https://github.com/apache/hbase/pull/378#discussion_r303223499
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
##########
@@ -155,54 +145,57 @@ private void abort(String reason, Throwable cause) {
@Override
public void run() {
while (running) {
+ boolean periodic = false;
long now = System.currentTimeMillis();
checkLowReplication(now);
- boolean periodic = false;
- if (!rollLog.get()) {
- periodic = (now - this.lastrolltime) > this.rollperiod;
- if (!periodic) {
- synchronized (rollLog) {
+ periodic = (now - this.lastrolltime) > this.rollPeriod;
+ if (periodic) {
+ // Time for periodic roll, fall through
+ LOG.debug("Wal roll period {} ms elapsed", this.rollPeriod);
+ } else {
+ synchronized (this) {
+ if (walNeedsRoll.values().stream().anyMatch(Boolean::booleanValue)) {
+ // WAL roll requested, fall through
Review comment:
This looks good.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services