On Monday, January 5, 2015 at 2:58:17 AM UTC-6, Noel Grandin wrote:
>
> Hi
>
> Thanks for your problem report and investigation.
>
> I have committed a fix for this.
>
> Regards, Noel.
>
I have a question about the state of this. The original logic, pre-r4139
was very simple:
---
public synchronized void commit(Session session) {
checkOpen();
openForWriting();
log.commit(session.getId());
if (log.getSize() - logSizeBase > maxLogSize) {
checkpoint();
logSizeBase = log.getSize();
}
}
---
The behavior here is that it will only call checkpoint() when the size
grows more than some threshold, logSizeBase is always set even if
log.getSize() didn't change. It is the loss of always setting logSizeBase
when calling checkpoint() that probably caused the performance problems.
If you had a long running transaction and logSizeBase got set only once,
then it is very possible that checkpoint() was getting called for every
commit.
The current logic still doesn't reset logSizeBase and I think that is key.
I also think that there are two "happy path" tests and the first one is
unnecessary because the second one will always be true if the first one is.
I think PageStore.commit() should look like:
---
public synchronized void commit(Session session) {
checkOpen();
openForWriting();
log.commit(session.getId());
long size = log.getSize();
if (size - logSizeBase > maxLogSize / 2) {
checkpoint();
logSizeBase = log.getSize();
if (logSizeBase < size || size < maxLogSize) {
ignoreBigLog = false;
return;
}
if (!ignoreBigLog) {
ignoreBigLog = true;
trace.error(null,
"Transaction log could not be truncated; size: " +
(newSize / 1024 / 1024) + " MB");
}
}
}
---
The above gets you the original behavior (r4138) back with the only
addition being the one-shot logging with that one-shot being reset when the
"happy path" happens.
Ken Jorissen
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.