Skip to content

PHOENIX-6541 Use ROW_TIMESTAMP column value as timestamps for conditional upsert mutations - #1300

Merged
gjacoby126 merged 2 commits into
apache:4.xfrom
tkhurana:PHOENIX-6541
Sep 14, 2021
Merged

PHOENIX-6541 Use ROW_TIMESTAMP column value as timestamps for conditional upsert mutations#1300
gjacoby126 merged 2 commits into
apache:4.xfrom
tkhurana:PHOENIX-6541

Conversation

@tkhurana

Copy link
Copy Markdown
Contributor

No description provided.

@tkhurana

Copy link
Copy Markdown
ContributorAuthor

@gokceni@gjacoby126

if (!builder.isEnabled(m) && !builder.isAtomicOp(m)) {
// or if it is an atomic op and its timestamp is already set
if (!builder.isEnabled(m) &&
(!builder.isAtomicOp(m) || getMaxTimestamp(m) != HConstants.LATEST_TIMESTAMP)) {

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.

Should this be && rather than ||? The comment says "and" not "or"

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.

Agree with gokcen, something looks missing here.

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.

@ankitjain64@gokceni It is correct but I will restructure it to make it more readable

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

Either the code comment or the code needs to change

String original = "ORIGINAL";
String updated = "UPDATED";
String duplicate = "DUPLICATE";
long rowTimestamp = EnvironmentEdgeManager.currentTimeMillis() - 10;

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.

Curious is there a particular reason to subtract 10 ms from the rowTimestamp. ?

@tkhuranatkhuranaSep 13, 2021

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.

@ankitjain64 We just wanted a value that is less than the current time. 10 is chosen arbitrarily.

}
ResultSet rs = stmt.executeQuery();
assertTrue(rs.next());
assertEquals(count, rs.getInt(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.

from the jira description looks like we want to make sure correct timestamps are used for the mutation but we are not validating that in the test case and just the row count. Is that sufficient @tkhurana ?

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.

@ankitjain64 I was able to repro the problem with just checking row count but I will add the asserts for timestamps also

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 31sDocker 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 56s4.x passed
+1 💚compile1m 4s4.x passed
+1 💚checkstyle1m 6s4.x passed
+1 💚javadoc0m 46s4.x passed
+0 🆗spotbugs3m 2sphoenix-core in 4.x has 958 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall9m 43sthe patch passed
+1 💚compile1m 2sthe patch passed
+1 💚javac1m 2sthe patch passed
-1 ❌checkstyle1m 5sphoenix-core: The patch generated 1 new + 646 unchanged - 0 fixed = 647 total (was 646)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 42sthe patch passed
+1 💚spotbugs3m 11sthe patch passed
_ Other Tests _
+1 💚unit138m 26sphoenix-core in the patch passed.
+1 💚asflicense0m 12sThe patch does not generate ASF License warnings.
179m 40s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1300/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1300
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux 25f3741de41e 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / cc32ab0
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-1300/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-1300/1/testReport/
Max. process+thread count5996 (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-1300/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 🆗reexec0m 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.
_ 4.x Compile Tests _
+1 💚mvninstall19m 1s4.x passed
+1 💚compile1m 6s4.x passed
+1 💚checkstyle1m 2s4.x passed
+1 💚javadoc0m 46s4.x passed
+0 🆗spotbugs3m 11sphoenix-core in 4.x has 958 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall10m 17sthe patch passed
+1 💚compile1m 2sthe patch passed
+1 💚javac1m 2sthe patch passed
-1 ❌checkstyle1m 8sphoenix-core: The patch generated 3 new + 644 unchanged - 2 fixed = 647 total (was 646)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 51sthe patch passed
+1 💚spotbugs3m 37sthe patch passed
_ Other Tests _
+1 💚unit177m 55sphoenix-core in the patch passed.
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
221m 33s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1300/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1300
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux fa3f58b0c0aa 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / cc32ab0
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-1300/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-1300/2/testReport/
Max. process+thread count6016 (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-1300/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.

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

Thanks @tkhurana ! It seems like build failed but LGTM.

@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, thanks @tkhurana

@gjacoby126

Copy link
Copy Markdown
Contributor

@ankitjain64 - do you have any other comments or suggestions for this PR? Otherwise I will merge.

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

Thanks @tkhurana

@ankitjain64

Copy link
Copy Markdown
Contributor

@ankitjain64 - do you have any other comments or suggestions for this PR? Otherwise I will merge.

Sure, you can merge this PR.

@gjacoby126
gjacoby126 merged commit df6a9d1 into apache:4.xSep 14, 2021
gjacoby126 pushed a commit that referenced this pull request Sep 14, 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

@tkhurana@stoty@gjacoby126@ankitjain64@gokceni