<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>100274</bug_id>
          
          <creation_ts>2012-10-24 11:32:19 -0700</creation_ts>
          <short_desc>[Linux] SQLite databases are slow on filesystems with write barriers enabled</short_desc>
          <delta_ts>2016-02-02 06:30:53 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>103890</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Zan Dobersek">zan</reporter>
          <assigned_to name="Zan Dobersek">zan</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>beidson</cc>
    
    <cc>j.isorce</cc>
    
    <cc>jturcotte</cc>
    
    <cc>kbalazs</cc>
    
    <cc>michael</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>749865</commentid>
    <comment_count>0</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2012-10-24 11:32:19 -0700</bug_when>
    <thetext>[Linux] SQLite databases are slow on filesystems with write barriers enabled</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>749867</commentid>
    <comment_count>1</comment_count>
      <attachid>170440</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2012-10-24 11:34:31 -0700</bug_when>
    <thetext>Created attachment 170440
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>749869</commentid>
    <comment_count>2</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2012-10-24 11:35:02 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; [Linux] SQLite databases are slow on filesystems with write barriers enabled

Explained here:
https://bugs.webkit.org/show_bug.cgi?id=96862#c9
https://bugs.webkit.org/show_bug.cgi?id=96862#c11</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766673</commentid>
    <comment_count>3</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2012-11-14 02:37:07 -0800</bug_when>
    <thetext>*** Bug 101614 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766676</commentid>
    <comment_count>4</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2012-11-14 02:38:32 -0800</bug_when>
    <thetext>This will solve an annoying issue with WTR as well: bug 101614. Somebody please put an r+ on this! :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766703</commentid>
    <comment_count>5</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2012-11-14 03:08:30 -0800</bug_when>
    <thetext>This makes sense for testing but I don&apos;t think this is good for end users.

Wouldn&apos;t it be better to let the WTR injected bundle control this setting instead?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766732</commentid>
    <comment_count>6</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2012-11-14 04:13:31 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; This makes sense for testing but I don&apos;t think this is good for end users.
&gt; 
&gt; Wouldn&apos;t it be better to let the WTR injected bundle control this setting instead?

In CookiJarQt we use this setting for end users as well. Synchronized mode is very slow and also it seems unstable so I would vote for turning it off in for users as well, not because it&apos;s easier to implement but because it is better for them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766743</commentid>
    <comment_count>7</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2012-11-14 04:28:37 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; In CookiJarQt we use this setting for end users as well. Synchronized mode is very slow and also it seems unstable so I would vote for turning it off in for users as well, not because it&apos;s easier to implement but because it is better for them.

I don&apos;t think it&apos;s right either for the cookie jar, we have no code dealing with the possibility of a corrupted databases and it _will_ happen out there somewhere.
Synchronized is set to normal by default for a reason, because it&apos;s better in most cases. No, it&apos;s not unstable. For a network cache DB I understand that it could make sense to disable it (no real data is lost), but for user data IMO it&apos;s wrong.

Tell my why it&apos;s better for them to risk having their data corrupted? In this case the user will most likely not even notice the delay added by fsync.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766786</commentid>
    <comment_count>8</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2012-11-14 05:34:31 -0800</bug_when>
    <thetext>By unstability I was thinking about bug 101614. If the fsync can crash than it adds risk not reduce it. Actually we have code to deal with data corruption, see IconDatabase::checkIntegrity. Btw IconDatabase is also a cache so IMHO data loss is not fatal as long as we can handle it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766804</commentid>
    <comment_count>9</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2012-11-14 06:02:16 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; By unstability I was thinking about bug 101614. If the fsync can crash than it adds risk not reduce it.

With the data given on that bug, I have difficulties believing that this is a bug in SQLite. Could you reproduce it on any other machine than yours?

The real problem that we have to fix is that the tests take longer to run than they should.

&gt; Actually we have code to deal with data corruption, see IconDatabase::checkIntegrity. Btw IconDatabase is also a cache so IMHO data loss is not fatal as long as we can handle it.

Right now we don&apos;t, not for CookiJarQt, and neither for other uses of SQLiteDatabase. If we handle it it&apos;s fine, but having users asking on forums and getting told that the solution to their obscure problem is to delete some ~/.local/someDatabase.db is what I would like to avoid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766954</commentid>
    <comment_count>10</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-11-14 09:01:53 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt;  Btw IconDatabase is also a cache so IMHO data loss is not fatal as long as we can handle it.

I can assure you that users don&apos;t see the IconDatabase as a cache, and we will reject any attempt to treat it as such on our platform.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>766955</commentid>
    <comment_count>11</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-11-14 09:03:01 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #8)
&gt; &gt;  Btw IconDatabase is also a cache so IMHO data loss is not fatal as long as we can handle it.
&gt; 
&gt; I can assure you that users don&apos;t see the IconDatabase as a cache, and we will reject any attempt to treat it as such on our platform.

(I know this bug is only about Linux, I&apos;m just warning anyone who - in the future - might think this type of change is solid cross platform)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>781283</commentid>
    <comment_count>12</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2012-12-03 03:14:11 -0800</bug_when>
    <thetext>(Based on the loosely formed consensus that the &apos;problematic&apos; behavior should only be avoided in testing.)

I was thinking of how to implement this and am currently holding an opinion that it would require complex paths taken that wouldn&apos;t justify the trade-off:
- a setting in an injected bundle that&apos;s then handled in WebKit2,
- a WebKit2-specific setting that is then communicated to WebCore,
- a new setting in WebCore::Settings interface that is not even reachable directly from SQLiteDatabase.

I&apos;m at the moment in favor of putting information on wiki about disabling the write barriers in fstab.

Opinions?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>781406</commentid>
    <comment_count>13</comment_count>
    <who name="Allan Sandfeld Jensen">allan.jensen</who>
    <bug_when>2012-12-03 06:43:23 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt; (Based on the loosely formed consensus that the &apos;problematic&apos; behavior should only be avoided in testing.)
&gt; 
&gt; I was thinking of how to implement this and am currently holding an opinion that it would require complex paths taken that wouldn&apos;t justify the trade-off:
&gt; - a setting in an injected bundle that&apos;s then handled in WebKit2,
&gt; - a WebKit2-specific setting that is then communicated to WebCore,
&gt; - a new setting in WebCore::Settings interface that is not even reachable directly from SQLiteDatabase.
&gt; 
&gt; I&apos;m at the moment in favor of putting information on wiki about disabling the write barriers in fstab.
&gt; 
&gt; Opinions?

I believe the Cookie-database would be better as an injected bundle, or fetched over  IPC. Having it hard-coded as an SQLite database has always been an too inflexible choice when we want QtWebKit to be a toolkit for a browser and not a browser in itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>814043</commentid>
    <comment_count>14</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-01-23 02:32:48 -0800</bug_when>
    <thetext>(In reply to comment #13)
&gt; (In reply to comment #12)
&gt; &gt; (Based on the loosely formed consensus that the &apos;problematic&apos; behavior should only be avoided in testing.)
&gt; &gt; 
&gt; &gt; I was thinking of how to implement this and am currently holding an opinion that it would require complex paths taken that wouldn&apos;t justify the trade-off:
&gt; &gt; - a setting in an injected bundle that&apos;s then handled in WebKit2,
&gt; &gt; - a WebKit2-specific setting that is then communicated to WebCore,
&gt; &gt; - a new setting in WebCore::Settings interface that is not even reachable directly from SQLiteDatabase.
&gt; &gt; 
&gt; &gt; I&apos;m at the moment in favor of putting information on wiki about disabling the write barriers in fstab.
&gt; &gt; 
&gt; &gt; Opinions?
&gt; 
&gt; I believe the Cookie-database would be better as an injected bundle, or fetched over  IPC. Having it hard-coded as an SQLite database has always been an too inflexible choice when we want QtWebKit to be a toolkit for a browser and not a browser in itself.

This bug is not really about how and where the cookie database should operate. Rather than that it tries to address the problem of write barriers being enabled on some filesystems and how to work around that.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>170440</attachid>
            <date>2012-10-24 11:34:31 -0700</date>
            <delta_ts>2012-12-03 05:49:14 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-100274-20121024113306.patch</filename>
            <type>text/plain</type>
            <size>1729</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTMyMzE2CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZTcxYjYwNzZiOTA0ZGMy
YTQ2NDQ4ZDk2MTFmNzM0ZGYyNGU5MzQwYy4uN2U0ZTU4Y2M4MGFjNmE2YWJkYmUwZGI4NTY1MTM5
OTdhN2VmMGVjNCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE5IEBACisyMDEyLTEwLTI0ICBaYW4g
RG9iZXJzZWsgIDx6YW5kb2JlcnNla0BnbWFpbC5jb20+CisKKyAgICAgICAgW0xpbnV4XSBTUUxp
dGUgZGF0YWJhc2VzIGFyZSBzbG93IG9uIGZpbGVzeXN0ZW1zIHdpdGggd3JpdGUgYmFycmllcnMg
ZW5hYmxlZAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9
MTAwMjc0CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAg
U2V0IHRoZSBzeW5jaHJvbm91cyBwcmFnbWEgdG8gb2ZmIGZvciBTUUxpdGUgZGF0YWJhc2VzIG9u
IExpbnV4IE9TLiBUaGlzCisgICAgICAgIGF2b2lkcyBwZXJmb3JtYW5jZSBpc3N1ZXMgd2hlbiB3
cml0aW5nIHRvIGEgZGF0YWJhc2Ugb24gYSBmaWxlc3lzdGVtIHdpdGgKKyAgICAgICAgd3JpdGUg
YmFycmllcnMgZW5hYmxlZC4KKworICAgICAgICBObyBuZXcgdGVzdHMgLSBubyBuZXcgdGVzdGFi
bGUgZnVuY3Rp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