pg_dump/pg_dumpall do not dump storage servers or storage user mappings

オープン
#2,315 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, postgresql, sql
領域
databases

調査の方向性

Start in src/bin/pg_dump/ and pg_dumpall, where the dump of roles and tablespaces is emitted, and check how --globals-only picks its objects. The catalogs to read are gp_storage_server and gp_storage_user_mapping. Done means the dump emits CREATE STORAGE SERVER and CREATE STORAGE USER MAPPING before per-database content, with the credential options handled like user-mapping options. Owner and comment output depends on #2312 landing first.

索引モデルが issue の本文から書いたものです。

説明

Apache Cloudberry version

main (verified on a build of 3.0.0-devel)

What happened

Neither pg_dump nor pg_dumpall emits storage servers (gp_storage_server) or storage user mappings (gp_storage_user_mapping). There is no reference to either catalog anywhere under src/bin/pg_dump/.

As a result, a dump/restore (or any upgrade path that relies on pg_dumpall) silently loses every storage server definition, its options, and all storage user mappings. Directory tables that refer to those servers cannot work after the restore until the servers are recreated by hand.

This gap will also cover the properties added by #2312 (ALTER STORAGE SERVER ... OWNER TO and COMMENT ON STORAGE SERVER, for #1299). Neither a non-default owner nor a comment would survive a dump either.

What you think should happen instead

Because storage servers and their user mappings are cluster-wide (shared catalogs), pg_dumpall should emit them, as it does for roles and tablespaces:

  • CREATE STORAGE SERVER ... OPTIONS (...)
  • ALTER STORAGE SERVER ... OWNER TO ... (once #2312 lands)
  • COMMENT ON STORAGE SERVER ... IS ... (once #2312 lands)
  • CREATE STORAGE USER MAPPING FOR ... STORAGE SERVER ... OPTIONS (...)

They should be emitted before per-database content, so that directory tables restore against existing servers. Storage user mapping options may contain credentials, so they deserve the same consideration as user-mapping options in pg_dump. They should probably also be included in --globals-only.

How to reproduce
CREATE ROLE sm_owner;
CREATE STORAGE SERVER s1 OPTIONS (endpoint 'x');
CREATE STORAGE USER MAPPING FOR sm_owner STORAGE SERVER s1 OPTIONS (accesskey 'k');
pg_dumpall --globals-only | grep -ci 'storage server'   # 0
pg_dumpall | grep -i 'storage server'                   # nothing
Operating System

Rocky Linux 8 (also applies to any platform; the code is missing)

Anything else

Found while reviewing #2312.

主要言語
C
スター
1.4k
フォーク
273
平均マージ
4日 6時間
マージ済み PR(30日)
105

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/cloudberry のほかの issue

apache/cloudberry の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。