Thread: data=writeback

data=writeback

From
"Priem, Alexander"
Date:
Hi everyone,

I have done some reading on filesystems and I thought to optimize the
settings for my PostgreSQL system. I use the ext3 filesystem and have the
PostgreSQL data and WAL on different physical drives. I made some
adjustments to my /etc/fstabd file, so it looks like this :


LABEL=/                 /                     ext3
noatime,data=ordered    1 1
LABEL=/boot             /boot                 ext3
noatime,data=ordered    1 2
none                    /dev/pts              devpts       gid=5,mode=620
0 0
none                    /proc                 proc         defaults
0 0
none                    /dev/shm              tmpfs        defaults
0 0
LABEL=/usr/local/pgsql  /usr/local/pgsql      ext3
noatime,data=writeback  1 2
LABEL=/usr/local/pgsql  /usr/local/pgsql/wal  ext3
noatime,data=ordered    1 2
/dev/sda5               swap                  swap         defaults
0 0
/dev/cdrom              /mnt/cdrom            udf,iso9660
noauto,owner,kudzu,ro   0 0
/dev/fd0                /mnt/floppy           auto
noauto,owner,kudzu      0 0


Does this look OK? My knowledge of filesystems and their (journalling)
options is not very broad...

Thanks in advance,
Alexander Priem.




Re: data=writeback

From
Chris
Date:
> LABEL=/usr/local/pgsql  /usr/local/pgsql      ext3
> noatime,data=writeback  1 2
> LABEL=/usr/local/pgsql  /usr/local/pgsql/wal  ext3
> noatime,data=ordered    1 2

The same label mounted on two different mount points is probably I typo?

I'm not sure if data=writeback is ok. I was wondering about the same
thing after reading the "good pc but bad performance,why?" thread.

This is from man mount:

  writeback
  Data ordering is not preserved - data may be written into
  the  main file system after its metadata has been commit-
  ted to the journal.  This is rumoured to be the  highest-
  throughput  option.   It  guarantees internal file system
  integrity, however it can allow old  data  to  appear  in
  files after a crash and journal recovery.

How does this relate to fflush()? Does fflush still garantee
all data has ben written?

Bye, Chris.



Re: data=writeback

From
"Priem, Alexander"
Date:
> > LABEL=/usr/local/pgsql  /usr/local/pgsql      ext3
> > noatime,data=writeback  1 2
> > LABEL=/usr/local/pgsql  /usr/local/pgsql/wal  ext3
> > noatime,data=ordered    1 2
>
> The same label mounted on two different mount points is probably I typo?


No, the same label mounted on two different mount points is not a typo. This
is the way it is in my /etc/fstab.

Note that I did not create this file myself, it was created by the RedHat
Enterprise Linux 3 ES installer. I created different partitions for the data
directory (/usr/local/pgsql) and the wal directory (/usr/local/pgsql/wal)
using the installer and this is how the /etc/fstab file ended up.

Why, is this bad? They use the same label, but use different mount points?
Can this cause problems?


Re: data=writeback

From
Chris
Date:
> > > LABEL=/usr/local/pgsql  /usr/local/pgsql      ext3
> > > noatime,data=writeback  1 2
> > > LABEL=/usr/local/pgsql  /usr/local/pgsql/wal  ext3
> > > noatime,data=ordered    1 2
> >
> > The same label mounted on two different mount points is probably I typo?
>
>
> No, the same label mounted on two different mount points is not a typo. This
> is the way it is in my /etc/fstab.
>
> Note that I did not create this file myself, it was created by the RedHat
> Enterprise Linux 3 ES installer. I created different partitions for the data
> directory (/usr/local/pgsql) and the wal directory (/usr/local/pgsql/wal)
> using the installer and this is how the /etc/fstab file ended up.
>
> Why, is this bad? They use the same label, but use different mount points?
> Can this cause problems?

Mmm... how can the mounter distinguish the two partitions?

Maybe I'm missing a concept here, but I thought labels must uniquely
identify partitions?

Seems suspicious to me...

Does it work? When you give just "mount" at the command line what output
do you get?

Bye, Chris.



Re: data=writeback

From
"Priem, Alexander"
Date:
> > > > LABEL=/usr/local/pgsql  /usr/local/pgsql      ext3
> > > > noatime,data=writeback  1 2
> > > > LABEL=/usr/local/pgsql  /usr/local/pgsql/wal  ext3
> > > > noatime,data=ordered    1 2
> > >
> > > The same label mounted on two different mount points is probably I
> > > typo?
> >
> >
> > No, the same label mounted on two different mount points is not a
> > typo. This is the way it is in my /etc/fstab.
> >
> > Note that I did not create this file myself, it was created by the
> > RedHat Enterprise Linux 3 ES installer. I created different partitions
> > for the data directory (/usr/local/pgsql) and the wal directory
> > (/usr/local/pgsql/wal) using the installer and this is how the
> > /etc/fstab file ended up.
> >
> > Why, is this bad? They use the same label, but use different mount
> > points? Can this cause problems?
>
> Mmm... how can the mounter distinguish the two partitions?
>
> Maybe I'm missing a concept here, but I thought labels must uniquely
identify partitions?
>
> Seems suspicious to me...
>
> Does it work? When you give just "mount" at the command line what output
do you get?
>
> Bye, Chris.

When I give "mount" at the command line, everything looks just fine :

/dev/sda2 on / type ext3 (rw,noatime,data=ordered)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/sda1 on /boot type ext3 (rw,noatime,data=ordered)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/sdb1 on /usr/local/pgsql type ext3 (rw,noatime,data=writeback)
/dev/sda3 on /usr/local/pgsql/wal type ext3 (rw,noatime,data=ordered)

It looks like the labels are not really used, just the mount-points. Or
could this cause other problems I am not aware of? Everything seems to be
working just fine, for several months now...



Re: data=writeback

From
Date:
> When I give "mount" at the command line, everything looks just fine :
>
> /dev/sda2 on / type ext3 (rw,noatime,data=ordered)
> none on /proc type proc (rw)
> usbdevfs on /proc/bus/usb type usbdevfs (rw)
> /dev/sda1 on /boot type ext3 (rw,noatime,data=ordered)
> none on /dev/pts type devpts (rw,gid=5,mode=620)
> none on /dev/shm type tmpfs (rw)
> /dev/sdb1 on /usr/local/pgsql type ext3 (rw,noatime,data=writeback)
> /dev/sda3 on /usr/local/pgsql/wal type ext3 (rw,noatime,data=ordered)
>
> It looks like the labels are not really used, just the mount-points. Or
> could this cause other problems I am not aware of? Everything seems to
> be working just fine, for several months now...

Probably /dev/sdb1 and /dev/sda3 have the same labels and mount
simply mounts them in a consistent way according to some logic
we're not aware of.

I'd say: if it works don't touch it ;)

What remains unresolved is the question whether data=writeback is ok
or not. We'll see if somebody has more information on that one...

Bye, Chris.







Re: data=writeback

From
Bruce Momjian
Date:
list@1006.org wrote:
> > When I give "mount" at the command line, everything looks just fine :
> >
> > /dev/sda2 on / type ext3 (rw,noatime,data=ordered)
> > none on /proc type proc (rw)
> > usbdevfs on /proc/bus/usb type usbdevfs (rw)
> > /dev/sda1 on /boot type ext3 (rw,noatime,data=ordered)
> > none on /dev/pts type devpts (rw,gid=5,mode=620)
> > none on /dev/shm type tmpfs (rw)
> > /dev/sdb1 on /usr/local/pgsql type ext3 (rw,noatime,data=writeback)
> > /dev/sda3 on /usr/local/pgsql/wal type ext3 (rw,noatime,data=ordered)
> >
> > It looks like the labels are not really used, just the mount-points. Or
> > could this cause other problems I am not aware of? Everything seems to
> > be working just fine, for several months now...
>
> Probably /dev/sdb1 and /dev/sda3 have the same labels and mount
> simply mounts them in a consistent way according to some logic
> we're not aware of.
>
> I'd say: if it works don't touch it ;)
>
> What remains unresolved is the question whether data=writeback is ok
> or not. We'll see if somebody has more information on that one...

Should be fine.  We don't continue until fsync() writes all the data.
We don't care what order it is written in, just that is all written
before we continue.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073