Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToC cache is effectively not used after the first shutdown #3873

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions h2/src/main/org/h2/engine/Database.java
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading