Skip to content

PHOENIX-6273: Add support to handle MR Snapshot restore externally - #1079

Merged
gjacoby126 merged 11 commits into
apache:masterfrom
sakshamgangwar:PHOENIX-6273
Jan 22, 2021
Merged

PHOENIX-6273: Add support to handle MR Snapshot restore externally#1079
gjacoby126 merged 11 commits into
apache:masterfrom
sakshamgangwar:PHOENIX-6273

Conversation

@sakshamgangwar

Copy link
Copy Markdown
Contributor

@stoty

stoty commented Jan 8, 2021

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec2m 7sDocker 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.
_ master Compile Tests _
+1 💚mvninstall18m 11smaster passed
+1 💚compile1m 22smaster passed
+1 💚checkstyle0m 33smaster passed
+1 💚javadoc0m 52smaster passed
+0 🆗spotbugs3m 59sphoenix-core in master has 956 extant spotbugs warnings.
_ Patch Compile Tests _
-1 ❌mvninstall1m 39sroot in the patch failed.
+1 💚compile1m 16sthe patch passed
+1 💚javac1m 16sthe patch passed
-1 ❌checkstyle0m 39sphoenix-core: The patch generated 9 new + 175 unchanged - 2 fixed = 184 total (was 177)
-1 ❌whitespace0m 0sThe patch 3 line(s) with tabs.
+1 💚javadoc0m 53sthe patch passed
+1 💚spotbugs3m 51sthe patch passed
_ Other Tests _
-1 ❌unit198m 2sphoenix-core in the patch failed.
+1 💚asflicense0m 25sThe patch does not generate ASF License warnings.
236m 54s
ReasonTests
Failed junit testsphoenix.end2end.index.ImmutableIndexExtendedIT
SubsystemReport/Notes
DockerClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux 4904e88ab7e1 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / edbd6e8
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
mvninstallhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/1/artifact/yetus-general-check/output/patch-mvninstall-root.txt
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
whitespacehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/1/artifact/yetus-general-check/output/whitespace-tabs.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/1/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/1/testReport/
Max. process+thread count5803 (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-1079/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.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec5m 49sDocker 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.
_ master Compile Tests _
+1 💚mvninstall16m 43smaster passed
+0hbaserecompile24m 39sHBase recompiled.
+1 💚compile1m 5smaster passed
+1 💚checkstyle0m 34smaster passed
+1 💚javadoc0m 55smaster passed
+0 🆗spotbugs3m 17sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
-1 ❌mvninstall0m 29sroot in the patch failed.
+0hbaserecompile10m 42sHBase recompiled.
-1 ❌compile0m 18sphoenix-core in the patch failed.
-1 ❌javac0m 18sphoenix-core in the patch failed.
-1 ❌checkstyle0m 34sphoenix-core: The patch generated 21 new + 174 unchanged - 3 fixed = 195 total (was 177)
-1 ❌whitespace0m 0sThe patch 26 line(s) with tabs.
+1 💚javadoc0m 51sthe patch passed
-1 ❌spotbugs0m 16sphoenix-core in the patch failed.
_ Other Tests _
-1 ❌unit0m 16sphoenix-core in the patch failed.
+1 💚asflicense0m 13sThe patch does not generate ASF License warnings.
47m 17s
SubsystemReport/Notes
DockerClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux e092a77fa222 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / 4b444cd
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
mvninstallhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/patch-mvninstall-root.txt
compilehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt
javachttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
whitespacehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/whitespace-tabs.txt
spotbugshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/patch-spotbugs-phoenix-core.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/2/testReport/
Max. process+thread count86 (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-1079/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.

@sakshamgangwar

Copy link
Copy Markdown
ContributorAuthor

@gjacoby126 Can you review again? As discussed offline, I have added configuration to handle whether we want to take care of snapshot restore within phoenix (this is being set as default) or we want to do it externally.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 19sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo 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.
_ master Compile Tests _
+1 💚mvninstall17m 13smaster passed
+0hbaserecompile24m 18sHBase recompiled.
+1 💚compile1m 26smaster passed
+1 💚checkstyle1m 2smaster passed
+1 💚javadoc1m 8smaster passed
+0 🆗spotbugs4m 3sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall12m 8sthe patch passed
+0hbaserecompile26m 51sHBase recompiled.
+1 💚compile1m 47sthe patch passed
+1 💚javac1m 47sthe patch passed
-1 ❌checkstyle1m 17sphoenix-core: The patch generated 43 new + 656 unchanged - 9 fixed = 699 total (was 665)
-1 ❌whitespace0m 0sThe patch 26 line(s) with tabs.
+1 💚javadoc1m 26sthe patch passed
+1 💚spotbugs5m 35sthe patch passed
_ Other Tests _
-1 ❌unit153m 5sphoenix-core in the patch failed.
+1 💚asflicense0m 52sThe patch does not generate ASF License warnings.
223m 25s
ReasonTests
Failed junit testsphoenix.schema.stats.NamespaceDisabledStatsCollectorIT
phoenix.schema.stats.NamespaceEnabledStatsCollectorIT
phoenix.end2end.IndexExtendedIT
phoenix.end2end.TableSnapshotReadsMapReduceIT
phoenix.end2end.PermissionNSEnabledIT
phoenix.end2end.MaxLookbackIT
SubsystemReport/Notes
DockerClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux 6ab67f130801 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / 4b444cd
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-1079/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
whitespacehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/3/artifact/yetus-general-check/output/whitespace-tabs.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/3/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/3/testReport/
Max. process+thread count9804 (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-1079/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.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 19sDocker 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.
_ master Compile Tests _
+1 💚mvninstall17m 32smaster passed
+0hbaserecompile24m 57sHBase recompiled.
+1 💚compile1m 6smaster passed
+1 💚checkstyle0m 44smaster passed
+1 💚javadoc0m 58smaster passed
+0 🆗spotbugs3m 30sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall10m 5sthe patch passed
+0hbaserecompile20m 42sHBase recompiled.
+1 💚compile1m 8sthe patch passed
+1 💚javac1m 8sthe patch passed
-1 ❌checkstyle0m 42sphoenix-core: The patch generated 22 new + 663 unchanged - 2 fixed = 685 total (was 665)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 54sthe patch passed
+1 💚spotbugs3m 35sthe patch passed
_ Other Tests _
-1 ❌unit165m 53sphoenix-core in the patch failed.
+1 💚asflicense0m 36sThe patch does not generate ASF License warnings.
225m 38s
ReasonTests
Failed junit testsphoenix.end2end.BinaryRowKeyIT
phoenix.end2end.PermissionNSEnabledWithCustomAccessControllerIT
phoenix.end2end.TableSnapshotReadsMapReduceIT
phoenix.end2end.PowerFunctionEnd2EndIT
phoenix.end2end.PermissionNSEnabledIT
phoenix.end2end.UpsertSelectIT
SubsystemReport/Notes
DockerClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux 0d2f8f34f893 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / f80e221
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-1079/4/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/4/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/4/testReport/
Max. process+thread count5601 (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-1079/4/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.

for (RegionInfo restoredRegion : restoredRegions) {
if (isValidRegion(restoredRegion)) {
this.regions.add(restoredRegion);
if (PhoenixConfigurationUtil.getMRSnapshotManagedInternally(configuration)) {

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.

Not sure I get this, We are again restoring per iterator which is per scan? Isn't this what caused the issue in the first place. I see that it is guarded by a configuration option but ideally we want to avoid this in all cases right? or to rephrase my question, who wants to set this to true?

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.

@bharathv doing the restore per MR job can be handled at one place but I was not able to get any spot to delete/cleanup the restore right after the job is done on phoenix side. On the caller side, I am able to do the cleanup, so in order to handle it in a clean way: I added this configuration to explicitly say: whether or not restore needs to be managed internally or externally. If internally I am keeping the original flow (with issue) as it is. Externally: restore + delete happens on the MR job caller side.

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.

IMO the original flow is wrong and can lead to pretty bad outcomes (like a file blow up), so we should get rid of restoring per task. If you still want to use this SnapshotManagedInternally() configuration, I'd suggest move it to once at setup and not once per scan.

@sakshamgangwarsakshamgangwar changed the title Phoenix-6273: All the map tasks should operate on the same restored snapshotPhoenix-6273: Add support to handle MR Snapshot restore externallyJan 21, 2021
@sakshamgangwar

Copy link
Copy Markdown
ContributorAuthor

@bharathv@gjacoby126 Can you review it one more time? Made changes based on review comments.

@shahrs87

Copy link
Copy Markdown
Contributor

If you change the title to all caps PHOENIX (for e.g.: PHOENIX-6273: Add support to handle MR Snapshot restore externally), it will link the PR to jira so that anyone can go directly from jira to this PR.

// provide an absolute path to inject your multi input mapper logic
public static final String MAPREDUCE_MULTI_INPUT_MAPPER_TRACKER_CLAZZ = "phoenix.mapreduce.multi.mapper.tracker.path";

// provide control to whether or not handle MR snapshot restore on phoenix side or handled by caller externally

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.

The naming convention for all other conf property starts with MAPREDUCE. Do you mind changing the property name to something like: "MAPREDUCE_SNAPSHOT_RESTORE_EXTERNAL" ? and prefix with DEFAULT for default value ?

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.

Also please change the phoenix conf string from phoenix.mr.manage.snapshot.restore.externally to "phoenix.mapreduce.snapshot.restore.externally" to be consistent with other property names.

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

Many minor nits. otherwise changes looks good.


public static boolean isMRSnapshotManagedExternally(final Configuration configuration) {
Preconditions.checkNotNull(configuration);
boolean isSnapshotRestoreManagedInternally =

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.

Typo in the variable name: isSnapshotRestoreManagedInternally. Should it be isSnapshotRestoreManagedExternally ?

// provide an absolute path to inject your multi input mapper logic
public static final String MAPREDUCE_MULTI_INPUT_MAPPER_TRACKER_CLAZZ = "phoenix.mapreduce.multi.mapper.tracker.path";

// provide control to whether or not handle MR snapshot restore on phoenix side or handled by caller externally

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.

Also could you please add couple of lines on what does it mean to manage internally vs externally ?

import java.util.Properties;

import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import static org.apache.phoenix.query.QueryServices.USE_STATS_FOR_PARALLELIZATION;

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.

I think all the static imports go to the top of the import list. Also all the java.util.* imports should come before org.apache.phoenix.* imports. Please change that.

public static void setMRSnapshotManagedExternally(Configuration configuration, Boolean isSnapshotRestoreManagedExternally) {
Preconditions.checkNotNull(configuration);
Preconditions.checkNotNull(isSnapshotRestoreManagedExternally);
configuration.set(MANAGE_MR_SNAPSHOT_RESTORE_EXTERNALLY,

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.

You can use setBoolean so that you don't have to convert boolean to string.

// provide an absolute path to inject your multi input mapper logic
public static final String MAPREDUCE_MULTI_INPUT_MAPPER_TRACKER_CLAZZ = "phoenix.mapreduce.multi.mapper.tracker.path";

// provide control to whether or not handle MR snapshot restore on phoenix side or handled by caller externally

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.

Also please change the phoenix conf string from phoenix.mr.manage.snapshot.restore.externally to "phoenix.mapreduce.snapshot.restore.externally" to be consistent with other property names.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

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.

Same comment about the import order as other comment.

assertFalse("Should only have stored" + result.size() + "rows in the table for the timestamp!", rs.next());
} finally {
if (isSnapshotRestoreDoneExternally) {
assertRestoreDirCount(conf, tmpDir.toString(), 1);

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.

Could you assert the restoredircount is more than 1 if isSnapshotRestoreDoneExternally is set to false ?

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.

@shahrs87 There were two levels of subdirectories getting created for snapshot restore on every scan:

PhoenixConfigurationUtil.setRestoreDirKey(configuration, newPath(restoreDir, UUID.randomUUID().toString()).toString());

this.restoreDir = newPath(configuration.get(PhoenixConfigurationUtil.RESTORE_DIR_KEY),

I have removed those in the original flow so now the directory gets cleaned up every single scan and gets created again for the next scan with the same directory structure.

I can assert here no existence of the restore directory in the original flow.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

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.

Import order is changed for all the files. Please revert back to original format.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 22sDocker 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.
_ master Compile Tests _
+1 💚mvninstall17m 15smaster passed
+0hbaserecompile24m 50sHBase recompiled.
+1 💚compile1m 4smaster passed
+1 💚checkstyle0m 44smaster passed
+1 💚javadoc0m 53smaster passed
+0 🆗spotbugs3m 15sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall10m 5sthe patch passed
+0hbaserecompile20m 23sHBase recompiled.
+1 💚compile1m 5sthe patch passed
+1 💚javac1m 5sthe patch passed
-1 ❌checkstyle0m 48sphoenix-core: The patch generated 25 new + 749 unchanged - 3 fixed = 774 total (was 752)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 51sthe patch passed
+1 💚spotbugs3m 28sthe patch passed
_ Other Tests _
-1 ❌unit118m 59sphoenix-core in the patch failed.
+1 💚asflicense0m 37sThe patch does not generate ASF License warnings.
178m 15s
SubsystemReport/Notes
DockerClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/5/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux b71602df69b8 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / e74857b
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-1079/5/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/5/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/5/testReport/
Max. process+thread count4765 (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-1079/5/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.

@sakshamgangwarsakshamgangwar changed the title Phoenix-6273: Add support to handle MR Snapshot restore externallyPHOENIX-6273: Add support to handle MR Snapshot restore externallyJan 21, 2021
@sakshamgangwar

Copy link
Copy Markdown
ContributorAuthor

@shahrs87@gjacoby126 Addressed comments on this PR, can you review again? Thanks!

this.scanIterator = UNINITIALIZED_SCANNER;
this.restoreDir = new Path(configuration.get(PhoenixConfigurationUtil.RESTORE_DIR_KEY),
UUID.randomUUID().toString());
this.restoreDir = new Path(configuration.get(PhoenixConfigurationUtil.RESTORE_DIR_KEY));

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.

Will it change any semantics if we are not adding uuid to the restoreDir path when isMRSnapshotManagedExternally is set to false ?

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.

@shahrs87 I don't think so. I believe the original flow was faulty in itself and for every scan, we were creating a subdirectory, not instead of that, we have the same subdirectory for restore and every scan restore happens there and clean up also happens per scan. So there should not be any issue. We want to get rid of this structure because when we do an external restore or external cleanup, we need to provide exact restore directory for reading it.

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.

@sakshamgangwar - Remember that scans are taking place in parallel as multiple mappers may be running at the same time. Until we fix the automation to only create once in a future JIRA, don't we need to keep the restored files in separate directories so tasks won't step on each other?

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.

@gjacoby126I missed that part, thanks for catching that. I will guard the directories with the same config as well.

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.

@gjacoby126 Can you review again? I have kept old behavior as it is, as well as in the assertion for restore directory I am asserting whether or not snapshot directory exists (in case of externally cleaned up) or not (cleaned up per scan).

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

meat of the patch lgtm, haven't looked at the tests but looks like other reviewers are taking a deeper look. +1.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec2m 26sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo 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.
_ master Compile Tests _
+1 💚mvninstall18m 0smaster passed
+0hbaserecompile26m 26sHBase recompiled.
+1 💚compile1m 6smaster passed
+1 💚checkstyle0m 43smaster passed
+1 💚javadoc0m 54smaster passed
+0 🆗spotbugs3m 24sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall9m 58sthe patch passed
+0hbaserecompile21m 20sHBase recompiled.
+1 💚compile1m 4sthe patch passed
+1 💚javac1m 4sthe patch passed
-1 ❌checkstyle0m 44sphoenix-core: The patch generated 27 new + 749 unchanged - 3 fixed = 776 total (was 752)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 54sthe patch passed
+1 💚spotbugs3m 34sthe patch passed
_ Other Tests _
-1 ❌unit122m 0sphoenix-core in the patch failed.
+1 💚asflicense0m 43sThe patch does not generate ASF License warnings.
185m 15s
ReasonTests
Failed junit testsphoenix.end2end.PermissionNSEnabledWithCustomAccessControllerIT
phoenix.end2end.ProductMetricsIT
phoenix.end2end.PermissionNSDisabledWithCustomAccessControllerIT
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/8/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
JIRA IssuePHOENIX-6273
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux 9322e9fd16c5 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / e19cc3f
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-1079/8/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/8/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/8/testReport/
Max. process+thread count8149 (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-1079/8/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.

if (PhoenixConfigurationUtil.isMRSnapshotManagedExternally(configuration)) {
this.restoreDir = new Path(configuration.get(PhoenixConfigurationUtil.RESTORE_DIR_KEY));
} else {
this.restoreDir = new Path(configuration.get(PhoenixConfigurationUtil.RESTORE_DIR_KEY),

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.

@sakshamgangwar why do we do the UUID in both the PhoenixMapReduceUtil and TableSnapshotResultIterator? Shouldn't it be one or the other? (If so, putting here in TableSnapshotResultIterator seems clearer to me.)

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.

@gjacoby126 that existed before this change as well, this is not a necessary code, I believe at job level in PhoenixMapReduceUtil we update the configuration restoreDir to a new path so as to make sure that even if restoreDir configuration sent from the caller is same for multiple jobs, it should be able to handle it internally by adding a new sub-directory (which we are also doing at scan level too :) ). Whereas in externally managed now we take full responsibility for the restoreDir creation/usage/deletion.

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

+1, assuming tests pass. Thanks @sakshamgangwar .

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 58sDocker 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.
_ master Compile Tests _
+1 💚mvninstall17m 18smaster passed
+0hbaserecompile24m 39sHBase recompiled.
+1 💚compile1m 7smaster passed
+1 💚checkstyle0m 43smaster passed
+1 💚javadoc0m 57smaster passed
+0 🆗spotbugs3m 35sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall10m 37sthe patch passed
+0hbaserecompile22m 21sHBase recompiled.
+1 💚compile1m 5sthe patch passed
+1 💚javac1m 5sthe patch passed
-1 ❌checkstyle0m 43sphoenix-core: The patch generated 28 new + 749 unchanged - 3 fixed = 777 total (was 752)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 51sthe patch passed
+1 💚spotbugs3m 30sthe patch passed
_ Other Tests _
-1 ❌unit149m 58sphoenix-core in the patch failed.
+1 💚asflicense0m 36sThe patch does not generate ASF License warnings.
211m 38s
ReasonTests
Failed junit testsphoenix.tx.TransactionIT
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/9/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
JIRA IssuePHOENIX-6273
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux da70eef4e1f8 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / e19cc3f
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-1079/9/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/9/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/9/testReport/
Max. process+thread count9715 (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-1079/9/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 🆗reexec1m 30sDocker 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.
_ master Compile Tests _
+1 💚mvninstall17m 5smaster passed
+0hbaserecompile25m 16sHBase recompiled.
+1 💚compile1m 5smaster passed
+1 💚checkstyle0m 44smaster passed
+1 💚javadoc0m 55smaster passed
+0 🆗spotbugs3m 20sphoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall10m 3sthe patch passed
+0hbaserecompile20m 55sHBase recompiled.
+1 💚compile1m 6sthe patch passed
+1 💚javac1m 6sthe patch passed
-1 ❌checkstyle0m 45sphoenix-core: The patch generated 26 new + 749 unchanged - 3 fixed = 775 total (was 752)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 52sthe patch passed
+1 💚spotbugs3m 31sthe patch passed
_ Other Tests _
-1 ❌unit114m 41sphoenix-core in the patch failed.
+1 💚asflicense0m 37sThe patch does not generate ASF License warnings.
174m 55s
ReasonTests
Failed junit testsphoenix.end2end.PermissionNSDisabledWithCustomAccessControllerIT
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/10/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1079
JIRA IssuePHOENIX-6273
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
unameLinux af35a6197b37 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revisionmaster / e19cc3f
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-1079/10/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unithttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/10/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/10/testReport/
Max. process+thread count9563 (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-1079/10/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.

@gjacoby126

Copy link
Copy Markdown
Contributor

@shahrs87 , when you get a minute could you please take another look and approve or request further changes?

@sakshamgangwar

Copy link
Copy Markdown
ContributorAuthor

@gjacoby126@shahrs87 I am observing only one test failure which is not related to my changes:
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1079/10/testReport/
PermissionNSDisabledWithCustomAccessControllerIT.testSuperUserCanChangePerms

@gjacoby126
gjacoby126 merged commit 317f3b7 into apache:masterJan 22, 2021
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.

5 participants

@sakshamgangwar@stoty@shahrs87@gjacoby126@bharathv