WIP partial replication patch

Поиск
Список
Период
Сортировка
От Boszormenyi Zoltan
Тема WIP partial replication patch
Дата
Msg-id 4C658F75.4080406@cybertec.at
обсуждение исходный текст
Ответы Re: WIP partial replication patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

attached is a WIP patch that will eventually implement
partial replication, with the following syntax:

CREATE REPLICA CLASS classname
    [ EXCLUDING RELATION ( relname [ , ... ] ) ]
    [ EXCLUDING DATABASE ( dbname [ , ... ] ) ]

ALTER REPLICA CLASS classname
    [ { INCLUDING | EXCLUDING } RELATION ( relname [ , ... ] ) ]
    [ { INCLUDING | EXCLUDING } DATABASE ( dbname [ , ... ] ) ]

The use case is to have a secondary server where read-only access
is allowed but (maybe for space reasons) some tables and databases
are excluded from the replication. The standby server keeps those tables
at the state of the last full backup but no further modification is done
to them.

The current patch adds two new global system tables, pg_replica and
pg_replicaitem and three new indexes to maintain the classes and their
contents.

The startup process in standby mode connects to a new database called
"replication" which is created at initdb time. This is needed because
transaction context is needed for accessing the syscache for the new tables.

There is a little nasty detail with the patch as it stands. The RelFileNode
triplet is currently treated as if it carried the relation Oid, but it's
not actually
true, the RelFileNode contains the relfilenode ID. Initially, without table
rewriting DDL,  the oid equals relfilenode, which was enough for a proof of
concept patch. I will need to extend the relmapper so it can carry more than
one "database-local" mapping info, so the filter can work in all database
at once. To be able to do this, all databases' pg_class should be read
initially
and re-read during relmapper cache invalidation. As a sidenode, this work
may serve as a basis for full cross-database relation access, too.

Best regards,
Zoltán Böszörményi


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: patch: utf8_to_unicode (trivial)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: review: xml_is_well_formed