Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Phase 2][YSQL] Dump tablegroups with tablespaces #10194

Closed
timothy-e opened this issue Oct 5, 2021 · 0 comments
Closed

[Phase 2][YSQL] Dump tablegroups with tablespaces #10194

timothy-e opened this issue Oct 5, 2021 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@timothy-e
Copy link
Contributor

timothy-e commented Oct 5, 2021

Jira Link: [DB-375](https://yugabyte.atlassian.net/browse/DB-375)
respect the --no-tablespaces option

-- yb_ysql_dump.sql

CREATE TABLEGROUP grp; -- (already exists in the test)
CREATE TABLEGROUP grp_with_spc TABLESPACE tblspc;
CREATE TABLE tbl16 (a int) WITH (autovacuum_enabled = true) TABLEGROUP grp_with_spc;
-- yb_ysql_dump.out

SET default_tablespace = '';

--
-- Name: grp; Type: TABLEGROUP; Schema: -; Owner: yugabyte_test
--

CREATE TABLEGROUP grp;


ALTER TABLEGROUP grp OWNER TO yugabyte_test;


SET default_tablespace = 'tblspc';

--
-- Name: grp_with_spc; Type: TABLEGROUP; Schema: -; Owner: yugabyte_test
--

CREATE TABLEGROUP grp_with_spc;


ALTER TABLEGROUP grp_with_spc OWNER TO yugabyte_test;

...

--
-- Name: tbl16; Type: TABLE; Schema: public; Owner: yugabyte_test
--

CREATE TABLE public.tbl16 (
    a integer
)
WITH (autovacuum_enabled='true')
TABLEGROUP grp_with_spc;


ALTER TABLE public.tbl16 OWNER TO yugabyte_test;
@timothy-e timothy-e self-assigned this Oct 5, 2021
@timothy-e timothy-e added the area/ysql Yugabyte SQL (YSQL) label Oct 5, 2021
@timothy-e timothy-e changed the title Dump tablegroups with tablespaces [YSQL] Dump tablegroups with tablespaces Oct 5, 2021
@timothy-e timothy-e moved this from To do to In progress in Setting Tablespaces for Tablegroups Nov 26, 2021
@timothy-e timothy-e changed the title [YSQL] Dump tablegroups with tablespaces [YSQL] Dump tablegroups with tablespaces [ready for review, but blocked by cherry-pick] Nov 30, 2021
@timothy-e timothy-e moved this from In progress to In Review in Setting Tablespaces for Tablegroups Nov 30, 2021
@timothy-e timothy-e moved this from In Review to In progress in Setting Tablespaces for Tablegroups Dec 1, 2021
@timothy-e timothy-e changed the title [YSQL] Dump tablegroups with tablespaces [ready for review, but blocked by cherry-pick] [YSQL] Dump tablegroups with tablespaces Dec 6, 2021
@timothy-e timothy-e moved this from In progress to In Review in Setting Tablespaces for Tablegroups Dec 13, 2021
@frozenspider frozenspider added this to To do in Colocation via automation Mar 16, 2022
@tverona1 tverona1 assigned frozenspider and unassigned timothy-e Apr 20, 2022
@tverona1 tverona1 changed the title [YSQL] Dump tablegroups with tablespaces [Phase 2][YSQL] Dump tablegroups with tablespaces May 17, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 17, 2022
Colocation automation moved this from To do to Done May 25, 2022
frozenspider added a commit that referenced this issue Oct 13, 2022
Summary:
The idea behind this diff is pretty simple: `ysql_dump` should include tablespaces in tablegroup declaration. However, while working on the diff, Java test framework problems were identified and fixed along the way.

Approximate summary of changes:

CXX:
* Unified `pgYbTablegroupTableExists` and `pgTablegroupTableExists`
* Populated `TablegroupInfo->grptablespace` to properly dump a tablespace.
* Declared `include-yb-metadata` flag for `ysql_dumpall` - it was used before, but wasn't properly documented.
* `yb_enable_create_with_table_oid` GUC variable is no longer needed for `ysql_dump`, removed it from the resulting dump.

Java:
* Simple process execution (output is forwarded, expect return code 0) extracted to `ProcessUtil.executeSimple`. Note that this somewhat overlaps with `CommandUtil.runShellCommand`, we'd probably want to unify them in future.
* Completely reworked `TestYsqlDump` test to align more with regression test logic. Expected files rearranged accordingly.'

Unrelated to that, removed an outdated bit from `README.md` for YSQL upgrade.

Original commit: 5198c37 / D14172

Test Plan: ybd --java-test org.yb.pgsql.TestYsqlDump

Reviewers: jason, telgersma, dsrinivasan, oleg

Reviewed By: oleg

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D20138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue
Projects
Status: Done
Development

No branches or pull requests

3 participants