<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="859051">
  <date_last_updated>2011-10-05 15:02:55.229362+00:00</date_last_updated>
  <duplicates>
    <bug id="858990"/>
  </duplicates>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/859051</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~pstoev-askmonty</bug_owner_link>
    <milestone_link>https://api.launchpad.net/1.0/maria/+milestone/5.2</milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/859051/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/859051/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/859051</bug_web_link>
  <owner>Philip Stoev</owner>
  <assignee>Michael Widenius</assignee>
  <milestone_title>Maria 5.2</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Periodic aria checkpoints prevent power management</title>
  <status>Fix Released</status>
  <importance>Medium</importance>
  <created>2011-09-25 17:22:50.625783+00:00</created>
  <description>
<![CDATA[A customer reports that even in the absence of any workload, there are periodic writes to the Aria log file, which in turn prevents his laptop from sleeping.

It seems possible to not do a checkpoint if no queries have been executed since previous checkpoint.]]>  </description>
  <activities>
    <activity datechanged="2011-09-25T17:22:50.625783+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Philip Stoev</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2011-09-25T17:22:59.466573+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Michael Widenius (monty)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Philip Stoev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-04T10:40:06.713868+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Invalid]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Michael Widenius</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-05T12:51:51.332290+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[5.2]]>      </newvalue>
      <whatchanged>maria: milestone</whatchanged>
      <person>Michael Widenius</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-05T12:51:53.441206+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[Medium]]>      </newvalue>
      <whatchanged>maria: importance</whatchanged>
      <person>Michael Widenius</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-05T12:51:59.148181+00:00">
      <oldvalue>
<![CDATA[Invalid]]>      </oldvalue>
      <newvalue>
<![CDATA[In Progress]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Michael Widenius</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-05T12:59:51.772674+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[lp:maria/5.2]]>      </newvalue>
      <whatchanged>branch linked</whatchanged>
      <person>Launchpad Janitor</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-05T15:02:54.629323+00:00">
      <oldvalue>
<![CDATA[In Progress]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Released]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Michael Widenius</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/859051/comments/1" datecreated="2011-10-04T10:40:02.277946+00:00">
      <person>Michael Widenius</person>
      <subject>
<![CDATA[Re: Periodic aria checkpoints prevent power management]]>      </subject>
      <content>
<![CDATA[Having aria doing checkpoints should not stop a laptop from sleeping.
A 'sleep' will suspend all processes as first part of the sleep so mysqld should be doing nothing.
I have a Lenovo laptop running OpenSuse 11.3 and there is no problem with putting it to sleep even if mysqld is running (I am doing that frequently).

Here is how the checkpoint works:

repeat
 Sleep 'checkpoint-time' seconds.
 If enough new data in transaction log file
   Do checkpoint

In other words, if there is nothing happening on the laptop, there is just a very short check once in a while if there is something that should be done (which is the feature that was requested).

InnoDB is doing something similar and there are dozen of processes in Linux that checks things once in a while (For example any 'clock' or process watching application will wake up once a second/minute but will not stop a laptop from sleeping).

Summary:  I don't know of anything special in Aria checkpoint that would interfere with laptop sleep and I don't know of any way to test/prove that.
]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/859051/comments/2" datecreated="2011-10-04T11:04:30.284876+00:00">
      <person>Philip Stoev</person>
      <subject>
<![CDATA[Re: Periodic aria checkpoints prevent power management]]>      </subject>
      <content>
<![CDATA[Maybe the original author of the bug report was refering not to a system-wide sleep, but to the HDD not being able to spin down due to some periodic HDD activity that was going on.]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/859051/comments/3" datecreated="2011-10-05T12:51:27.533006+00:00">
      <person>Michael Widenius</person>
      <subject>
<![CDATA[Re: Periodic aria checkpoints prevent power management]]>      </subject>
      <content>
<![CDATA[There should not be any spin up because of checkpoints in Aria.
If there is no write transactions in Aria, there is no checkpoint written to disk.

I did very this on my machine and noticed that it works as expected on 5.1 but on 5.2 there was a bug in the test
if changes has happened and the aria_log files was touched. As they where just touched and not getting larger I had not noticed this before.

Will now fix this in 5.2 and above.
]]>      </content>
    </comment>
  </comments>
  <branches>
    <branch>lp:~maria-captains/maria/5.2-bad</branch>
  </branches>
</launchpad-bug>
