Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Tue, Feb 19, 2019 at 2:03 AM Thomas Munro <thomas.mu...@gmail.com> wrote: > > How can we achieve that, without writing our > > own NFS client? > > <dons crash helmet> > > Instead of writing our own NFS client, how about writing our own > network storage protocol? Imagine a stripped-down postmaster process > running on the NFS server that essentially acts as a block server. > Through some sort of network chatter, it can exchange blocks with the > real postmaster running someplace else. The mini-protocol would > contain commands like READ_BLOCK, WRITE_BLOCK, EXTEND_RELATION, > FSYNC_SEGMENT, etc. - basically whatever the relevant operations at > the smgr layer are. And the user would see the remote server as a > tablespace mapped to a special smgr.
In reading this, I honestly thought somewhere along the way you'd say "and then you have WAL, so just run a replica and forget this whole network filesystem business." The practical issue of WAL replay being single-process is an issue though. It seems like your mini-protocol was going in a direction that would have allowed multiple processes to be working between the PG system and the storage system concurrently, avoiding the single-threaded issue with WAL but also making it such that the replica wouldn't be able to be used for read-only queries (without some much larger changes happening anyway). I'm not sure the use-case is big enough but it does seem to me that we're getting to a point where people are generating enough WAL with systems that they care an awful lot about that they might be willing to forgo having the ability to perform read-only queries on the replica as long as they know that they can flip traffic over to the replica without losing data. So, what this all really boils down to is that I think this idea of a different protocol that would allow PG to essentially replicate to a remote system, or possibly run entirely off of the remote system without any local storage, could be quite interesting in some situations. On the other hand, I pretty much agree 100% with Magnus that the NFS use-case is almost entirely because someone bought a big piece of hardware that talks NFS and no, you don't get to run whatever code you want on it. Thanks! Stephen
signature.asc
Description: PGP signature