googleapis / googleapis/java-bigtable-hbase

CheckAndMutate uses timestamps inconsistently

Open
#2,898 6 comments 0 reactions 0 assignees View on GitHub
api: bigtable external priority: p2 type: bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.