Skip to content

PHOENIX-6511 Deletes fail in case of failed region split - #1266

Merged
abhishek-chouhan merged 1 commit into
apache:4.xfrom
abhishek-chouhan:PHOENIX-6511
Jul 15, 2021
Merged

PHOENIX-6511 Deletes fail in case of failed region split#1266
abhishek-chouhan merged 1 commit into
apache:4.xfrom
abhishek-chouhan:PHOENIX-6511

Conversation

@abhishek-chouhan

Copy link
Copy Markdown
Contributor

No description provided.

@abhishek-chouhan

Copy link
Copy Markdown
ContributorAuthor

Note, this impacts 4.x only. 5.x has a different logic wrt. to handling this. In hbase2.x the split hooks got moved to master observer since master handles the split through procedures, hence only region close is blocked by the lock in UngroupedAggRegionObserver. In case of a region close, if an error is encountered RS is aborted which results in resetting the state and hence is not a problem.

@dbwong

Copy link
Copy Markdown
Contributor

Quick question i guess the assumption is if we are post split we can't be splitting again? Does a hbase state machine explicitly prevent this or is the assumption that there is no way a flush or set of flushes could cause this to be splitting again?

@abhishek-chouhan

Copy link
Copy Markdown
ContributorAuthor

@dbwong There was a small window between deleting the exclusive lock for region splitting and execution of the post hook. I've changed the PR so that we do our logic in the preRollbackSplit hook, which is executed just before deleting the lock.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec4m 20sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ 4.x Compile Tests _
+1 💚mvninstall18m 8s4.x passed
+1 💚compile1m 1s4.x passed
+1 💚checkstyle0m 35s4.x passed
+1 💚javadoc0m 42s4.x passed
+0 🆗spotbugs3m 4sphoenix-core in 4.x has 957 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall9m 41sthe patch passed
+1 💚compile1m 1sthe patch passed
+1 💚javac1m 1sthe patch passed
-1 ❌checkstyle0m 36sphoenix-core: The patch generated 5 new + 366 unchanged - 2 fixed = 371 total (was 368)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 46sthe patch passed
+1 💚spotbugs3m 15sthe patch passed
_ Other Tests _
+1 💚unit138m 29sphoenix-core in the patch passed.
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
182m 48s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1266
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux cfd6f569af32 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / ddd7ff6
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/1/testReport/
Max. process+thread count5605 (vs. ulimit of 30000)
modulesC: phoenix-core U: phoenix-core
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/1/console
versionsgit=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@kadirozdekadirozde 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.

LGTM. Thanks!

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec6m 33sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ 4.x Compile Tests _
+1 💚mvninstall17m 54s4.x passed
+1 💚compile1m 1s4.x passed
+1 💚checkstyle0m 35s4.x passed
+1 💚javadoc0m 47s4.x passed
+0 🆗spotbugs3m 0sphoenix-core in 4.x has 957 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall9m 43sthe patch passed
+1 💚compile1m 2sthe patch passed
+1 💚javac1m 2sthe patch passed
-1 ❌checkstyle0m 34sphoenix-core: The patch generated 3 new + 368 unchanged - 0 fixed = 371 total (was 368)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 44sthe patch passed
+1 💚spotbugs3m 14sthe patch passed
_ Other Tests _
+1 💚unit221m 44sphoenix-core in the patch passed.
+1 💚asflicense0m 10sThe patch does not generate ASF License warnings.
268m 0s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1266
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux db2aa0842c0f 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / ddd7ff6
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/2/testReport/
Max. process+thread count4954 (vs. ulimit of 30000)
modulesC: phoenix-core U: phoenix-core
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/2/console
versionsgit=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 29sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ 4.x Compile Tests _
+1 💚mvninstall17m 53s4.x passed
+1 💚compile1m 0s4.x passed
+1 💚checkstyle0m 36s4.x passed
+1 💚javadoc0m 47s4.x passed
+0 🆗spotbugs3m 2sphoenix-core in 4.x has 957 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall9m 42sthe patch passed
+1 💚compile1m 3sthe patch passed
+1 💚javac1m 3sthe patch passed
-1 ❌checkstyle0m 34sphoenix-core: The patch generated 5 new + 366 unchanged - 2 fixed = 371 total (was 368)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 44sthe patch passed
+1 💚spotbugs3m 11sthe patch passed
_ Other Tests _
+1 💚unit150m 49sphoenix-core in the patch passed.
+1 💚asflicense0m 12sThe patch does not generate ASF License warnings.
191m 1s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1266
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux 8bf90b2c72a3 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / ddd7ff6
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/3/testReport/
Max. process+thread count5638 (vs. ulimit of 30000)
modulesC: phoenix-core U: phoenix-core
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/3/console
versionsgit=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@virajjasanivirajjasani 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.

Left a couple of nits, +1 overall

Comment on lines +90 to +92
ObserverContext ctx = new ObserverContext<>(null);
ctx.prepare(region.getCoprocessorHost().findCoprocessorEnvironment(
UngroupedAggregateRegionObserver.class.getName()));

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.

nit: Since preSplit and preRollBackSplit requires ObserverContext<RegionCoprocessorEnvironment> specifically, we can define ObserverContext accordingly here:

 ObserverContext<RegionCoprocessorEnvironment> ctx = new ObserverContext<>(null);
ctx.prepare((RegionCoprocessorEnvironment) region.getCoprocessorHost().findCoprocessorEnvironment(
UngroupedAggregateRegionObserver.class.getName()));

setUpConfigForMiniCluster(conf);
hbaseTestUtil.startMiniCluster();
// establish url and quorum. Need to use PhoenixDriver and not PhoenixTestDriver
zkQuorum = "localhost:" + hbaseTestUtil.getZkCluster().getClientPort();

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.

nit: could be a local variable than a class level field

@abhishek-chouhan

Copy link
Copy Markdown
ContributorAuthor

Thanks for the reviews @virajjasani@dbwong@kadirozde

@abhishek-chouhan
abhishek-chouhan merged commit fb40ece into apache:4.xJul 15, 2021
@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec5m 37sDocker mode activated.
-1 ❌patch0m 5s#1266 does not apply to 4.x. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1266
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1266/4/console
versionsgit=2.7.4
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

UngroupedAggregateRegionObserver obs =
(UngroupedAggregateRegionObserver) region.getCoprocessorHost()
.findCoprocessor(UngroupedAggregateRegionObserver.class.getName());
ObserverContext<RegionCoprocessorEnvironment> ctx = new ObserverContext<>(null);

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.

4.x still support jdk1.7 now, seems compile broken:
UngroupedAggregateRegionObserverSplitFailureIT.java:[91,69] cannot infer type arguments for org.apache.hadoop.hbase.coprocessor.ObserverContext<>
[ERROR] reason: cannot infer type-variable(s) E
[ERROR] (actual and formal argument lists differ in length)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for pointing this out. Turns out that the constructor is different between 1.4 and later. Fixed the issue now y using compatObserverContext

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.

6 participants

@abhishek-chouhan@dbwong@stoty@comnetwork@virajjasani@kadirozde