pgsql: Enforce a specific order for probing library loadability in pg_u

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Enforce a specific order for probing library loadability in pg_u
Дата
Msg-id E1br3uZ-00073o-Ja@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Enforce a specific order for probing library loadability in pg_upgrade.

pg_upgrade checks whether all the shared libraries used in the old cluster
are also available in the new one by issuing LOAD for each library name.
Previously, it cared not what order it did the LOADs in.  Ideally it
should not have to care, but currently the transform modules in contrib
fail unless both the language and datatype modules they depend on are
loaded first.  A backend-side solution for that looks possible but
probably not back-patchable, so as a stopgap measure, let's do the LOAD
tests in order by library name length.  That should fix the problem for
reasonably-named transform modules, eg "hstore_plpython" will be loaded
after both "hstore" and "plpython".  (Yeah, it's a hack.)

In a larger sense, having a predictable order of these probes is a good
thing, since it will make upgrades predictably work or not work in the
face of inter-library dependencies.  Also, this patch replaces O(N^2)
de-duplication logic with O(N log N) logic, which could matter in
installations with very many databases.  So I don't foresee reverting this
even after we have a proper fix for the library-dependency problem.

In passing, improve a couple of SQL queries used here.

Per complaint from Andrew Dunstan that pg_upgrade'ing the transform contrib
modules failed.  Back-patch to 9.5 where transform modules were introduced.

Discussion: <f7ac29f3-515c-2a44-21c5-ec925053265f@dunslane.net>

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/bac56dbe090670408551bd68690e91f7b0207ccf

Modified Files
--------------
src/bin/pg_upgrade/function.c | 97 ++++++++++++++++++++++++++++++-------------
1 file changed, 67 insertions(+), 30 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Change the way pre-reading in external sort's merge phase works.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Enforce a specific order for probing library loadability in pg_u