[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15672636#comment-15672636 ] Hudson commented on HBASE-17096: FAILURE: Integrated in Jenkins build Phoenix-master #1493 (See [https://builds.apache.org/job/Phoenix-master/1493/]) PHOENIX-3482 Provide a work around for HBASE-17096 (Samarth: rev 7cdd7ca00574a6d815d367be883952bc30d006fc) * (edit) phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain >Assignee: Heng Chen > Fix For: 0.98.24 > > Attachments: HBASE-17096-0.98.patch, HBASE-17096-0.98.v2.patch > > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15671061#comment-15671061 ] Hudson commented on HBASE-17096: FAILURE: Integrated in Jenkins build HBase-0.98-on-Hadoop-1.1 #1290 (See [https://builds.apache.org/job/HBase-0.98-on-Hadoop-1.1/1290/]) HBASE-17096 checkAndMutateApi doesn't work correctly on 0.98.19+ (apurtell: rev ccf3108ac15c62164dbf10e03d07e298fd402008) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java * (edit) hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain >Assignee: Heng Chen > Fix For: 0.98.24 > > Attachments: HBASE-17096-0.98.patch, HBASE-17096-0.98.v2.patch > > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15668082#comment-15668082 ] Hudson commented on HBASE-17096: FAILURE: Integrated in Jenkins build HBase-0.98-matrix #418 (See [https://builds.apache.org/job/HBase-0.98-matrix/418/]) HBASE-17096 checkAndMutateApi doesn't work correctly on 0.98.19+ (apurtell: rev ccf3108ac15c62164dbf10e03d07e298fd402008) * (edit) hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain >Assignee: Heng Chen > Fix For: 0.98.24 > > Attachments: HBASE-17096-0.98.patch, HBASE-17096-0.98.v2.patch > > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15667705#comment-15667705 ] Andrew Purtell commented on HBASE-17096: Thank you very much for your prompt attention to this issue [~chenheng], very much appreciated. LGTM, committing shortly. > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > Fix For: 0.98.24 > > Attachments: HBASE-17096-0.98.patch, HBASE-17096-0.98.v2.patch > > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15667612#comment-15667612 ] Hadoop QA commented on HBASE-17096: --- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 10m 30s {color} | {color:blue} Docker mode activated. {color} | | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s {color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s {color} | {color:green} The patch appears to include 1 new or modified test files. {color} | | {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue} 2m 55s {color} | {color:blue} Maven dependency ordering for branch {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 3m 44s {color} | {color:green} 0.98 passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 45s {color} | {color:green} 0.98 passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 1m 23s {color} | {color:green} 0.98 passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 35s {color} | {color:green} 0.98 passed {color} | | {color:red}-1{color} | {color:red} findbugs {color} | {color:red} 0m 55s {color} | {color:red} hbase-client in 0.98 has 16 extant Findbugs warnings. {color} | | {color:red}-1{color} | {color:red} findbugs {color} | {color:red} 1m 40s {color} | {color:red} hbase-server in 0.98 has 84 extant Findbugs warnings. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 49s {color} | {color:green} 0.98 passed {color} | | {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue} 0m 9s {color} | {color:blue} Maven dependency ordering for patch {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 52s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 45s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 45s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 1m 11s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 24s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s {color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} hadoopcheck {color} | {color:green} 10m 26s {color} | {color:green} The patch does not cause any errors with Hadoop 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.1 2.6.2 2.6.3 2.7.1. {color} | | {color:green}+1{color} | {color:green} hbaseprotoc {color} | {color:green} 0m 32s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 3m 3s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 48s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} unit {color} | {color:green} 1m 13s {color} | {color:green} hbase-client in the patch passed. {color} | | {color:green}+1{color} | {color:green} unit {color} | {color:green} 120m 19s {color} | {color:green} hbase-server in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 49s {color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 164m 32s {color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=1.11.2 Server=1.11.2 Image:yetus/hbase:ef91163 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12838975/HBASE-17096-0.98.v2.patch | | JIRA Issue | HBASE-17096 | | Optional Tests | asflicense javac javadoc unit findbugs hadoopcheck hbaseanti checkstyle compile | | uname | Linux fdce81ac1431 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/hbase.sh | | git revision | 0.98 / 1ed7354 | | Default Java | 1.7.0_80 | | findbugs | v2.0.1 | | findbugs | https://builds.apache.org/job/PreCommit-HBASE-Build/4475/artifact/patchprocess/branch-findbugs-hbase-client-warnings.html | | findbugs |
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15667090#comment-15667090 ] Heng Chen commented on HBASE-17096: --- Let me check it. :) > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > Attachments: HBASE-17096-0.98.patch > > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15666408#comment-15666408 ] Andrew Purtell commented on HBASE-17096: I have a working revert of HBASE-15629 staged. However, the scope of change in the revert is too large. This commit touched a number of files in the client, introduced and modified message defs in Client.proto, and introduced new interfaces. A revert also clobbers later work that enforces RPC timeouts on checkAndMutate. I'm going to work on at least narrowing this down to a partial revert tomorrow, perhaps will isolate the bug and so can fix it. > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > Attachments: HBASE-17096-0.98.patch > > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15666289#comment-15666289 ] Andrew Purtell commented on HBASE-17096: A bisect between rel/0.98.17 to rel/0.98.19 leads to {noformat} 95dca64665a4b6999841f728b68143861d06bb93 is the first bad commit commit 95dca64665a4b6999841f728b68143861d06bb93 Author: chenhengDate: Wed Apr 13 12:15:47 2016 +0800 HBASE-15629 Backport HBASE-14703 to 0.98+ Signed-off-by: Andrew Purtell :04 04 37ba7a5175c025115bc9ff961714730601646afa 12b1bb3fb3be12a87406367498a7b5bdf78fa8b5 M hbase-client :04 04 d09c25c5cbeefd59117b5093bfa169df61f61162 2a3e3e82ffc9c6cd25b13c22b3e3ae8f6d5b6de1 M hbase-protocol :04 04 839dddf858f565ccd9b528e118a6819717ee216d 709f68babc8d02369f9d4abd3b8bb5a89ac7ba74 M hbase-server {noformat} > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15666214#comment-15666214 ] Andrew Purtell commented on HBASE-17096: I can reproduce with a client side test. > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-17096) checkAndMutateApi doesn't work correctly on 0.98.19+
[ https://issues.apache.org/jira/browse/HBASE-17096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15666193#comment-15666193 ] Andrew Purtell commented on HBASE-17096: My first attempt at a reproduction using a new unit in HRegion tests did not reproduce the behavior. {code} @Test public void testCheckAndMutate_HBASE17096() throws IOException { byte[] row = Bytes.toBytes("ROW"); byte[] qualifier = Bytes.toBytes("QUALIFIER"); byte[] oldValue = null; byte[] newValue = Bytes.toBytes("VALUE"); // Setting up region String method = this.getName(); this.region = initHRegion(tableName, method, CONF, fam1); try { Put put = new Put(row); put.add(fam1, qualifier, newValue); assertTrue(region.checkAndMutate(row, fam1, qualifier, CompareOp.EQUAL, new BinaryComparator(oldValue), put, true)); Delete delete = new Delete(row); assertTrue(region.checkAndMutate(row, fam1, qualifier, CompareOp.EQUAL, new BinaryComparator(newValue), delete, true)); assertFalse(region.checkAndMutate(row, fam1, qualifier, CompareOp.EQUAL, new BinaryComparator(newValue), delete, true)); } finally { HRegion.closeHRegion(this.region); this.region = null; } } {code} This bypasses the client side, RPC processing, and does not specify a TTL in the schema. I'll try again now with a closer approximation as a new unit for client side tests. > checkAndMutateApi doesn't work correctly on 0.98.19+ > > > Key: HBASE-17096 > URL: https://issues.apache.org/jira/browse/HBASE-17096 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > Below is the test case. It uses some Phoenix APIs for getting hold of admin > and HConnection but should be easily adopted for an HBase IT test. The second > checkAndMutate should return false but it is returning true. This test fails > with HBase-0.98.23 and works fine with HBase-0.98.17 > {code} > @Test > public void testCheckAndMutateApi() throws Exception { > byte[] row = Bytes.toBytes("ROW"); > byte[] tableNameBytes = Bytes.toBytes(generateUniqueName()); > byte[] family = Bytes.toBytes(generateUniqueName()); > byte[] qualifier = Bytes.toBytes("QUALIFIER"); > byte[] oldValue = null; > byte[] newValue = Bytes.toBytes("VALUE"); > Put put = new Put(row); > put.add(family, qualifier, newValue); > try (Connection conn = DriverManager.getConnection(getUrl())) { > PhoenixConnection phxConn = conn.unwrap(PhoenixConnection.class); > try (HBaseAdmin admin = phxConn.getQueryServices().getAdmin()) { > HTableDescriptor tableDesc = new HTableDescriptor( > TableName.valueOf(tableNameBytes)); > HColumnDescriptor columnDesc = new HColumnDescriptor(family); > columnDesc.setTimeToLive(120); > tableDesc.addFamily(columnDesc); > admin.createTable(tableDesc); > HTableInterface tableDescriptor = > admin.getConnection().getTable(tableNameBytes); > assertTrue(tableDescriptor.checkAndPut(row, family, > qualifier, oldValue, put)); > Delete delete = new Delete(row); > RowMutations mutations = new RowMutations(row); > mutations.add(delete); > assertTrue(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > assertFalse(tableDescriptor.checkAndMutate(row, family, > qualifier, CompareOp.EQUAL, newValue, mutations)); > } > } > } > {code} > FYI, [~apurtell], [~jamestaylor], [~lhofhansl]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)