未验证 提交 e5a72377 编写于 作者: V Vlad Ilyushchenko 提交者: GitHub

fix(cairo): table writer incorrectly calculated maxTimestamp is active partition is missing (#137)

上级 cf9406d5
......@@ -53,7 +53,7 @@
<dependency>
<groupId>org.questdb</groupId>
<artifactId>core</artifactId>
<version>4.1.6-SNAPSHOT</version>
<version>4.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
......
......@@ -32,7 +32,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<version>4.1.6-SNAPSHOT</version>
<version>4.2.0-SNAPSHOT</version>
<groupId>org.questdb</groupId>
<artifactId>core</artifactId>
<packaging>jar</packaging>
......
......@@ -2138,7 +2138,7 @@ public class TableWriter implements Closeable {
// 2. read max timestamp
TableUtils.dFile(path.trimTo(p), metadata.getColumnName(metadata.getTimestampIndex()));
maxTimestamp = TableUtils.readLongAtOffset(ff, path, tempMem8b, transientRowCount - Long.BYTES);
maxTimestamp = TableUtils.readLongAtOffset(ff, path, tempMem8b, (transientRowCount - 1) * Long.BYTES);
actualSize -= transientRowCount;
LOG.info()
.$("updated active partition [name=").$(path.trimTo(p).$())
......
......@@ -61,7 +61,7 @@ public class TableRepairTest extends AbstractGriffinTest {
Assert.assertTrue(reader.reload());
Assert.assertEquals(95040, reader.size());
Assert.assertEquals(874790000000L, w.getMaxTimestamp());
Assert.assertEquals(950390000000L, w.getMaxTimestamp());
TableWriter.Row row = w.newRow(w.getMaxTimestamp());
row.putInt(0, 150);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册