Thomas Munro <thomas.mu...@gmail.com> writes: > On Thu, Mar 11, 2021 at 1:16 PM Tom Lane <t...@sss.pgh.pa.us> wrote: >> I'm a little skeptical about the "simple" part. At minimum, you'd >> have to syncfs() each tablespace, since we have no easy way to tell >> which of them are on different filesystems. (Although, if we're >> presuming this is Linux-only, we might be able to tell with some >> unportable check or other.)
> Right, the patch knows about that: I noticed that the syncfs man page present in RHEL8 seemed a little squishy on the critical question of error reporting. It promises that syncfs will wait for I/O completion, but it doesn't say in so many words that I/O errors will be reported (and the list of applicable errno codes is only EBADF, not very reassuring). Trolling the net, I found a newer-looking version of the man page, and behold it says In mainline kernel versions prior to 5.8, syncfs() will fail only when passed a bad file descriptor (EBADF). Since Linux 5.8, syncfs() will also report an error if one or more inodes failed to be written back since the last syncfs() call. So this means that in less-than-bleeding-edge kernels, syncfs can only be regarded as a dangerous toy. If we expose an option to use it, there had better be large blinking warnings in the docs. regards, tom lane