googleapis / googleapis/java-bigtable-hbase
CheckAndMutate uses timestamps inconsistently
- Dominant language
- Java
- Stars
- 184
- Forks
- 184
- Avg merge
- 10h
- Merged PRs (30d)
- 6
Description
#### Steps to reproduce
```java
@Test
void testCantReadMyOwnWrites() throws IOException {
Table table = // TODO
byte[] row = Bytes.toBytes(System.currentTimeMillis());
byte[] q = Bytes.toBytes("q");
byte[] f = Bytes.toBytes("f");
byte[] A = Bytes.toBytes("aaa");
byte[] B = Bytes.toBytes("bbb");
boolean success = table
.checkAndMutate(row, f).qualifier(q).ifNotExists()
.thenPut(new Put(row).addColumn(f, q, A));
assertThat(success).isTrue();
table.put(new Put(row).addColumn(f, q, B));
byte[] value = table.get(new Get(row)).getValue(f, q);
assertThat(value).isEqualTo(B); // 👈 this fails
}
```
This (generally) works when setting a breakpoint on `table.put(new Put(row).addColumn(f, q, B));` - i.e. slowing down the operation with the breakpoint seems to "fix" it.
Contributor guide
Assessment
This issue has not been assessed yet.