Skip to content

Commit

Permalink
Merge pull request #3873 from andreitokar/at-misc
Browse files Browse the repository at this point in the history
ToC cache is effectively not used after the first shutdown
  • Loading branch information
andreitokar committed Aug 18, 2023
2 parents 6a51ba4 + 9312571 commit 3f1be47
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions h2/src/main/org/h2/engine/Database.java
Expand Up @@ -1761,6 +1761,10 @@ public boolean isReadOnly() {
return readOnly;
}

public int getWriteDelay() {
return store.getMvStore().getAutoCommitDelay();
}

public void setWriteDelay(int value) {
store.getMvStore().setAutoCommitDelay(value < 0 ? 0 : value);
}
Expand Down
4 changes: 2 additions & 2 deletions h2/src/main/org/h2/mvstore/FileStore.java
Expand Up @@ -1692,11 +1692,11 @@ public void setCacheSize(int mb) {
}

void cacheToC(C chunk, long[] toc) {
chunksToC.put(chunk.version, toc, toc.length * 8L + Constants.MEMORY_ARRAY);
chunksToC.put(chunk.id, toc, toc.length * 8L + Constants.MEMORY_ARRAY);
}

private long[] cleanToCCache(C chunk) {
return chunksToC.remove(chunk.version);
return chunksToC.remove(chunk.id);
}

public void populateInfo(BiConsumer<String, String> consumer) {
Expand Down
1 change: 1 addition & 0 deletions h2/src/main/org/h2/table/InformationSchemaTable.java
Expand Up @@ -2975,6 +2975,7 @@ private void settings(SessionLocal session, ArrayList<Row> rows) {
add(session, rows, "NON_KEYWORDS", ParserBase.formatNonKeywords(nonKeywords));
}
add(session, rows, "RETENTION_TIME", Integer.toString(database.getRetentionTime()));
add(session, rows, "WRITE_DELAY", Integer.toString(database.getWriteDelay()));
// database settings
for (Map.Entry<String, String> entry : database.getSettings().getSortedSettings()) {
add(session, rows, entry.getKey(), entry.getValue());
Expand Down

0 comments on commit 3f1be47

Please sign in to comment.