Skip to content

HBASE-23181 Blocked WAL archive: "LogRoller: Failed to schedule flush of XXXX, because it is not online on us" - #739

Closed
Apache9 wants to merge 1 commit into
apache:masterfrom
Apache9:HBASE-23157
Closed

HBASE-23181 Blocked WAL archive: "LogRoller: Failed to schedule flush of XXXX, because it is not online on us"#739
Apache9 wants to merge 1 commit into
apache:masterfrom
Apache9:HBASE-23157

Conversation

@Apache9

@Apache9Apache9 commented Oct 21, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

@saintstack@binlijin PTAL. This is another way to fix the problem of HBASE-23157. The idea is simple, just remove everything in SequenceIdAccounting when we write a close region marker.

Why introducing a new parameter instread of checking the edit when appending is that, the append is single threaded so we'd better do less in it, and also passing a protobuf message back from a byte array can throw IOException, which is a bit annoying as we do not expect IOExceptions for lots of methods.

And maybe this could also solve HBASE-23181, but I still think we need to find out the root cause for HBASE-23181 and add a UT for it, maybe there are still other problems.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec1m 56sDocker mode activated.
_ Prechecks _
💚dupname0m 1sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 24 new or modified test files.
_ master Compile Tests _
💙mvndep0m 36sMaven dependency ordering for branch
💚mvninstall6m 47smaster passed
💚compile2m 8smaster passed
💚checkstyle2m 47smaster passed
💚shadedjars5m 46sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 24smaster passed
💙spotbugs4m 28sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 15smaster passed
_ Patch Compile Tests _
💙mvndep0m 16sMaven dependency ordering for patch
💚mvninstall5m 41sthe patch passed
💚compile1m 51sthe patch passed
💚javac1m 51sthe patch passed
💔checkstyle1m 28shbase-server: The patch generated 2 new + 373 unchanged - 17 fixed = 375 total (was 390)
💔checkstyle0m 20shbase-mapreduce: The patch generated 2 new + 2 unchanged - 0 fixed = 4 total (was 2)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 38spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 42sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 16sthe patch passed
💚findbugs6m 1sthe patch passed
_ Other Tests _
💚unit3m 6shbase-common in the patch passed.
💔unit261m 50shbase-server in the patch failed.
💚unit24m 24shbase-mapreduce in the patch passed.
💚asflicense1m 52sThe patch does not generate ASF License warnings.
363m 45s
ReasonTests
Failed junit testshadoop.hbase.master.TestSplitWALManager
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/1/artifact/out/Dockerfile
GITHUB PR#739
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 5bdec0fb24e6 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-739/out/precommit/personality/provided.sh
git revisionmaster / da9a53e
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/1/artifact/out/diff-checkstyle-hbase-server.txt
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/1/artifact/out/diff-checkstyle-hbase-mapreduce.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/1/testReport/
Max. process+thread count5445 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server hbase-mapreduce U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@binlijin

binlijin commented Oct 22, 2019

Copy link
Copy Markdown
Contributor

The idea is good, it can solve the problem that make regionservers have too many wals, but the master may still have the warn message:
2019-10-07 21:09:49,101 WARN [B.defaultRpcServer.handler=201,queue=21,port=60000] master.ServerManager: RegionServer 9.46.144.221,60020,1565160409765 indicates a last flushed sequence id (24529281) that is less than the previous last flushed sequence id (24529341) for region gdtdata_20191007,5680,1570302605714.187ad7634f6ca396fa2aab5cc5c83b61. Ignoring.

Looks like the warn do not make any problem?

@Apache9

Copy link
Copy Markdown
ContributorAuthor

The warning does not lead to actual problem but I think we should still avoid it. Maybe another issue? I think we should find a better way to find the proper flushed sequence id for reporting to master.

@saintstack

Copy link
Copy Markdown
Contributor

I thought about doing this but thought it too obnoxious. It also punts on what the actual issue is over in HBASE-23181, on why on close an extra edit can arrive after we've moved aside the Region Map in SequenceIdAccounting.

We could apply as a workaround or patch until we figure real issues?

@binlijin So that is why we get that message? I didn't think of that. Good one.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

But if we use ASYNC_WAL, the patch on HBASE-23181 can not solve the problem, as by design, ASYNC_WAL will not wait for the SyncFuture to complete...

So we have to manually remove the records in SequenceIdAccounting, after we make sure that the region has been closed and all data have been flushed out.

@saintstacksaintstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One question is if the close will cut off any edits in flight?

return Bytes.toString(b);
}

public String toStringBinary() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just make this a toString rather than add a new method?

System.currentTimeMillis(), value));
long txid = log.append(info, getWalKeyImpl(System.currentTimeMillis(), scopes), edit, true);
long txid =
log.append(info, getWalKeyImpl(System.currentTimeMillis(), scopes), edit, true, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense adding an override for append rather than make change everywhere append is called?

final boolean inMemstore, boolean closeRegion, ServerCall<?> rpcCall) {
super(key, edit);
this.inMemstore = inMemstore;
this.closeRegion = closeRegion;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have to add a flag? See WALUtil where we have createFlushWALEdit which uses special family and qualifier to denote an edit a FLUSH edit. Could do same here and skip the extra flag?

.collect(Collectors.joining(",", "{", "}")));
}
}
this.highestSequenceIds.remove(encodedRegionName);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good. This is like the purge method over in HBASE-23181.

* so we can finish an unfinished compaction -- it is not an edit for memstore.
* @param closeRegion Whether this is a region close marker, i.e, the last wal edit for this
* region on this region server. The WAL implementation should remove all the related
* stuff, for example, the sequence id accounting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec1m 57sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 1sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 24 new or modified test files.
_ master Compile Tests _
💙mvndep0m 38sMaven dependency ordering for branch
💚mvninstall5m 16smaster passed
💚compile1m 47smaster passed
💚checkstyle2m 16smaster passed
💚shadedjars4m 41sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 21smaster passed
💙spotbugs4m 7sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 43smaster passed
_ Patch Compile Tests _
💙mvndep0m 15sMaven dependency ordering for patch
💚mvninstall4m 59sthe patch passed
💚compile1m 46sthe patch passed
💚javac1m 46sthe patch passed
💚checkstyle0m 26sThe patch passed checkstyle in hbase-common
💚checkstyle1m 26shbase-server: The patch generated 0 new + 373 unchanged - 17 fixed = 373 total (was 390)
💚checkstyle0m 20sThe patch passed checkstyle in hbase-mapreduce
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 34spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 48sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 17sthe patch passed
💚findbugs5m 53sthe patch passed
_ Other Tests _
💚unit3m 6shbase-common in the patch passed.
💔unit280m 19shbase-server in the patch failed.
💚unit33m 1shbase-mapreduce in the patch passed.
💚asflicense1m 46sThe patch does not generate ASF License warnings.
385m 42s
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/2/artifact/out/Dockerfile
GITHUB PR#739
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 67466d64b9a5 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-739/out/precommit/personality/provided.sh
git revisionmaster / 2ad62b0
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/2/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/2/testReport/
Max. process+thread count5436 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server hbase-mapreduce U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/2/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

As proposed on slack in the direct message to @saintstack , let me try to introduce two methods in WAL interfacce, one is for appending data, and another is for appending marker, to avoid too many flags.

@binlijin

Copy link
Copy Markdown
Contributor

@Apache9 Yes, it another problem we need to find the root cause and fix it in another issue.

@binlijin

Copy link
Copy Markdown
Contributor

@saintstack i need to study it and figure out why we get that message.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

Hi @binlijin , please follow the steps on this page

https://cwiki.apache.org/confluence/display/OPENWHISK/Accessing+Apache+GitHub+as+a+Committer

to combine your github account and the asf account? You should be a member of HBase so you can merge pull requests. Now you are listed as a contributor...

@binlijin

Copy link
Copy Markdown
Contributor

@Apache9 OK.

@Apache9@saintstack
2019-10-07 21:09:49,101 WARN [B.defaultRpcServer.handler=201,queue=21,port=60000] master.ServerManager: RegionServer 9.46.144.221,60020,1565160409765 indicates a last flushed sequence id (24529281) that is less than the previous last flushed sequence id (24529341) for region gdtdata_20191007,5680,1570302605714.187ad7634f6ca396fa2aab5cc5c83b61. Ignoring.

After debuging i find this message caused by the same problem.
And it can be reproduced, i upload it in HBASE-23157, you can see the TestMaxFlushedSeqId.patch.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec3m 32sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 1sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 24 new or modified test files.
_ master Compile Tests _
💙mvndep0m 36sMaven dependency ordering for branch
💚mvninstall5m 14smaster passed
💚compile1m 47smaster passed
💚checkstyle2m 15smaster passed
💚shadedjars4m 40sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 18smaster passed
💙spotbugs3m 57sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 29smaster passed
_ Patch Compile Tests _
💙mvndep0m 16sMaven dependency ordering for patch
💚mvninstall4m 57sthe patch passed
💚compile1m 46sthe patch passed
💚javac1m 46sthe patch passed
💔checkstyle1m 29shbase-server: The patch generated 2 new + 373 unchanged - 17 fixed = 375 total (was 390)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 33spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 38sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 15sthe patch passed
💚findbugs5m 58sthe patch passed
_ Other Tests _
💚unit3m 8shbase-common in the patch passed.
💔unit287m 32shbase-server in the patch failed.
💚unit32m 8shbase-mapreduce in the patch passed.
💚asflicense1m 47sThe patch does not generate ASF License warnings.
393m 13s
ReasonTests
Failed junit testshadoop.hbase.client.TestSnapshotDFSTemporaryDirectory
hadoop.hbase.regionserver.TestHRegion
hadoop.hbase.regionserver.TestHRegionWithInMemoryFlush
hadoop.hbase.client.TestFromClientSideWithCoprocessor
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/3/artifact/out/Dockerfile
GITHUB PR#739
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 1324dd1d2bd8 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-739/out/precommit/personality/provided.sh
git revisionmaster / 2ad62b0
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/3/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/3/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/3/testReport/
Max. process+thread count5637 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server hbase-mapreduce U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-739/3/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@saintstack

Copy link
Copy Markdown
Contributor

Thanks for bringing up the " indicates a last flushed sequence id" message on the master. Good one. It is related. At least for the HBASE-23181 case, it makes sense because an entry goes into SequenceIdAccounting with a sequenceid that is one less than the flush sequenceid (somehow it is getting in after the flush the flush). Once it goes in, the Master starts complaining.

You added a whole new flushcache method to HRegion in TestMaxFlushedSeqId.patch. How is it different from the original? The test looks good. What do you see as the output? You can make it so a flush gets a sequenceid that is less than the last edit's sequenceid? The last edit does not make it into the flush? Its out of order?

Nice work.

@saintstack

Copy link
Copy Markdown
Contributor

@binlijin See above sir.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

I think this could be a follow on. It is the same problem, but we need to discuss how to fix it. If we think the current solution, where we remove all the related records when closing a region, is fine, then I think we could add some sequence ids back to the unflushedSequenceIds in completeCacheFlush, if we found that the current sequence id in the unflushedSequenceIds is even smaller then the flushedSequenceId.

As we will write a flush marker and wait for it to complete, so after flush we can make sure that there are no pending WAL entries for this region any more, so I think the solution above can work.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

Or let's change this PR against HBASE-23181, and use HBASE-23157 for addressing the flushed sequence id problem.

@Apache9Apache9 changed the title HBASE-23157 WAL unflushed seqId tracking may wrong when Durability.AS…HBASE-23181 Blocked WAL archive: "LogRoller: Failed to schedule flush of XXXX, because it is not online on us"Oct 24, 2019
@saintstack

saintstack commented Oct 24, 2019

Copy link
Copy Markdown
Contributor

What would be a follow on sir?

Diff between 23181 and this is a async wal. The patch on there at moment is bad I realize now

@Apache9

Copy link
Copy Markdown
ContributorAuthor

What would be a follow on sir?

Diff between 23181 and this is a sync wal. The patch on there at moment is bad I realize now.

Like I proposed above, we could do something in the completeCacheFlush to prevent the flushed sequence id go backwards. And this does not lead to data loss, only a warning log on master side which makes people a bit confusing, so I think it is fine to address it in a follow on issue.

Issuing a wal sync while holding the writeLock of updateLock is not good, and we have been doing a lot of works to avoid this...

I've already changed the title to HBASE-23181, if we all agree that this is fine, let's merge this, and then let's use Lijin Bin's new UT to address the flushed sequence id problem using HBASE-23157.

Thanks.

@binlijin

binlijin commented Oct 24, 2019

Copy link
Copy Markdown
Contributor

@saintstack
I added a whole new flushcache method to HRegion in TestMaxFlushedSeqId.patch, this method is to flush only some HStore and used by the test.
The test do two flush for a HRegion, the HRegion have two HStore, the first flush do flushing two HStore and the HRegion get maxFlushedSeqId=4 and the second flush only flush one HStore, and the HRegion get maxFlushedSeqId=2 which smaller than the flush before.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

Let's close this one, will open a new PR against HBASE-23181.

@saintstack

Copy link
Copy Markdown
Contributor

@binlijin we should fix that. It does not seem to be the behavior seen in HBASE-23181 though, right?

@Apache9 you see the comments above?

Ok on continuing on a new PR.

@binlijin

Copy link
Copy Markdown
Contributor

@saintstack Yes, they are not the same behavior, but for the same reason.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Apache9@Apache-HBase@binlijin@saintstack