Thread
-
Re: Simplifying wal_sync_method
Magnus Hagander <mha@sollentuna.net> — 2005-08-09T08:02:44Z
> > > > Currently, here are the options available for wal_sync_method: > > > > > > > > #wal_sync_method = fsync # the default > varies across platforms: > > > > # fsync, > fdatasync, fsync_writethrough, > > > > # open_sync, > open_datasync > > > > > > On same topic: > > > > > > > http://archives.postgresql.org/pgsql-general/2005-07/msg00811.php > > > > > > Why does win32 PostgreSQL allow data corruption by default? > > > > It behaves the same on Unix as Win32, and if you have > battery-backed > > cache, you don't need writethrough, so we don't have it as > default. I Correction, if you have bbwc, you *should not* have writethrough. Not only do you not need it, enabling it will drastically lower performance. > > am going to write a section in the manual for 8.1 about these > > reliability issues. > > For some reason I don't see "corruped database after crash" > reports on Unixen. Why? Because you don't read the lists often enough? I see it happen quite often. > Also, why can't win32 be safe without battery-backed cache? > I can't see such requirement on other platforms. It can, you just need to learn how to configure your system. There are two different options to make it safe on win32 without battery backed cache: 1) Use the postgresql option for fsync write through 2) Configure windows to disable write caching. If you do this, which you of course already do on all your windows servers without write cache I hope since it affects all windows operations including the filesystem itself, you are safe with the default settings in postgresql. I think what a lot of people don't realise is how easy option 2 is. It's in traditional windows style *a single checkbox* in the harddisk configuration. (Granted, you need a modern windows for that. On older windows it's a registry key) I have some code floating in my tree to issue a WARNING on startup if write cache is enabled and postgresql is not using writethrough. It's not quite ready yet, but if such a thing would be accepted post feature-freeze I can have it finished in good time before 8.1. It would be quite simple (looking at just the main data directory for example, ignoring tablespaces), but if you're dealing with complex installations you'd better have a clue about how windows works anyway... //Magnus
-
Re: Simplifying wal_sync_method
Marko Kreen <marko@l-t.ee> — 2005-08-09T09:15:16Z
On Tue, Aug 09, 2005 at 10:02:44AM +0200, Magnus Hagander wrote: > > > It behaves the same on Unix as Win32, and if you have > > battery-backed > > > cache, you don't need writethrough, so we don't have it as > > default. I > > Correction, if you have bbwc, you *should not* have writethrough. Not > only do you not need it, enabling it will drastically lower performance. So what? User should read docs how to get good performance. > > Also, why can't win32 be safe without battery-backed cache? > > I can't see such requirement on other platforms. > > It can, you just need to learn how to configure your system. There are > two different options to make it safe on win32 without battery backed > cache: I personally do not use PostgreSQL in win32 (yet - this may change). I just felt the pain of a guy who tried... > in traditional windows style *a single checkbox* in the harddisk > configuration. > (Granted, you need a modern windows for that. On older windows it's a > registry key) I think PostgreSQL should reliable by default. Now with the Windows port there are lot of people who just try it out on regular desktop machine. With point-n-click installer there's no need to read docs and after experiencing the unreliability they won't take it as serious database. > I have some code floating in my tree to issue a WARNING on startup if > write cache is enabled and postgresql is not using writethrough. It's > not quite ready yet, but if such a thing would be accepted post > feature-freeze I can have it finished in good time before 8.1. It would > be quite simple (looking at just the main data directory for example, > ignoring tablespaces), but if you're dealing with complex installations > you'd better have a clue about how windows works anyway... Hey, thats a good idea, irrespective whether the default changes or not. I think if it's just couple of checks and then printf, it should not meet much resistance. -- marko