Skip to content

Commit

Permalink
[pg15] merge: master branch commit '1f64b6ed7f3c93f69416d75ddffaec403…
Browse files Browse the repository at this point in the history
…dd3f76d' into pg15

Summary:
Merge YB master commit 1f64b6e titled

    [#20778] CDCSDK: Add retry logic over FlushTables calls in test

and committed 2024-03-07T13:26:11+05:30 into YB pg15.

- TestPgAlterTableChangePrimaryKey.java: YB master
  d5d7363 deletes this file, claiming
  relevant tests were moved to regress test yb_alter_table_rewrite.  YB
  pg15 branch made minor adjustments such as message changes.  Delete
  it.
- TestPgReplicationSlot.java: YB master
  ddbe411 takes test
  replicationConnectionConsumption and turns it into helper
  testReplicationConnectionConsumption which is called by
  replicationConnectionConsumption and
  replicationConnectionConsumptionMultipleBatches later in the file.  YB
  pg15 417e9b3 ignores test
  replicationConnectionConsumption, so do the same ignore to both tests.
- parallel.c: YB master cfda8c7 changes
  spacing for enumblacklistlen, but that declaration was removed in YB
  pg15, so ignore it.
- tablecmds.c:
  - AlteredTableInfo: trivial conflict on adding extra fields at the
    bottom with YB pg15 and YB master
    d5d7363.
  - function declarations: YB master
    d5d7363 adds extra parameter
    yb_wqueue to two functions.  YB pg15 has several changes in the
    area.  Trivial resolution.
  - ATRewriteTables: trivial conflict between YB pg15 merge
    5627af5 and YB master
    d5d7363 regarding both sides adding
    params to function make_new_heap.
  - YbATSetPKRewriteChildPartitions: YB master
    d5d7363 adds heap_open/heap_close,
    but upstream PG switched to table_open/table_close.
- slot.c: conflict between YB pg15 merge
  417e9b3 and YB master
  e5dbd2e.  Resolution appears to be to
  change "slot" to "s" and take YB master's change.
- slotfuncs.c:
  - pg_create_logical_replication_slot: adjacent lines conflict between
    YB master e5dbd2e and YB pg15 merge
    ed96733.
  - pg_get_replication_slots: merge YB master
    e5dbd2e and YB pg15 merge
    ed96733.
- ipci.c: upstream PG 0bd305ee1d427ef29f5fa4fa20567e3b3f5ff792 moves
  code into CalculateShmemSize.  YB
  bda4da7 touches code there.  Move
  that code to the new location.
- pg_dump.c: YB master 5659b73 adds
  use_roles_sql logic while upstream PG changes the area.  Merge.
- event_trigger.h: YB master d5d7363
  adds YB_AT_REWRITE_ALTER_PRIMARY_KEY as 0x16 while upstream PG
  578b229718e8f15fa779e20f086c4b6bb3776106 and
  b0483263dda0824cc49e3f8a022dab07e1cdf9a7 modify definitions for 0x08.
  Trivial merge.
- pgstat.h/wait_event.h: YB master
  bda4da7 touches
  yb_pgstat_report_wait_start, but YB pg15 merge
  5627af5 moves the function to
  wait_event.h.  Apply the modification there, and also move the
  associated yb_ash.h include.
- pgstat.c/wait_event.c: YB master
  bda4da7 touches functions formerly in
  pgstat.c now moved to wait_event.c.  Apply the same changes to the new
  location using

      sed -i 's/YBEnableAsh()/yb_ash_enable_infra/' src/postgres/src/backend/utils/activity/wait_event.c

- guc.c: YB master bda4da7 adds ASH
  GUCs with config groups RESOURCES and STATS_COLLECTOR that upstream PG
  removes.  Choose config group STATS_MONITORING for both GUCs.
- pg15_tests/passing_tests.tsv:
  - remove org.yb.pgsql.TestPgAlterTableChangePrimaryKey from the list
    as that test was deleted by YB master
    d5d7363.
  - remove org.yb.pgsql.TestPgRegressReplicationSlot and
    CDCSDKYsqlTest.TestReplicationSlotDropWithActiveInvalid from the
    list because these tests start failing due to actual bugs.  The
    source of the bugs is unclear, but in order to push forward merge
    progress, leave deeper investigation for later.
- pg15_tests/test_regress_table.sh: YB master
  d5d7363 adds new regress test which
  suffers the same serial type bug as yb_alter_table.  Add it to the
  list of tests expected to fail.

Test Plan:
Almalinux 8:

    #!/usr/bin/env bash
    set -eu
    ./yb_build.sh fastdebug --gcc11
    pg15_tests/run_tests.sh

Almalinux 8, fastdebug, gcc11, get the following results:

    0	2024-04-21T10:58:52-07:00	pgwrapper_pg_get_lock_status-test	PgGetLockStatusTest.TestGetLockStatusLimitNumTxnLocks
    0	2024-04-21T10:59:04-07:00	pgwrapper_pg_wait_on_conflict-test	PgWaitQueuesTest.TestDDLsNotBlockedOnWaiters
    0	2024-04-21T10:59:21-07:00	integration-tests_cdcsdk_ysql-test	CDCSDKYsqlTest.TestCDCStateEntryForReplicationSlot
    0	2024-04-21T11:00:33-07:00	pgwrapper_pg_wrapper-test	PgWrapperFlagsTest.*
    1	2024-04-21T11:30:42-07:00	JAVA	org.yb.pgsql.TestPgEncryption#testSslWithAuth[0]
    1	2024-04-21T12:02:00-07:00	JAVA	org.yb.pgsql.TestPgEncryption
    0	2024-04-21T12:02:11-07:00	master_clone_state_manager-test	CloneStateManagerTest.*
    0	2024-04-21T12:02:25-07:00	pgwrapper_pg_fkey-test	PgFKeyTest.SameTableReference
    1	2024-04-21T12:03:27-07:00	JAVA	org.yb.pgsql.TestPgRegressParallel#testPgRegressParallel
    1	2024-04-21T12:05:19-07:00	JAVA	org.yb.pgsql.TestPgParallelReadIsolation
    0	2024-04-21T12:05:50-07:00	integration-tests_wait_states-itest	WaitStateITest.*
    0	2024-04-21T12:10:29-07:00	integration-tests_wait_states-itest	*/AshTestVerifyOccurrence.VerifyWaitStateEntered/*
    0	2024-04-21T12:11:20-07:00	JAVA	org.yb.pgsql.TestYbBackup#testBackupRestoreRoles
    0	2024-04-21T12:12:11-07:00	JAVA	org.yb.pgsql.TestYbBackup#testBackupRolesWithoutUseRoles
    0	2024-04-21T12:13:01-07:00	JAVA	org.yb.pgsql.TestYbBackup#testBackupRolesWithoutRestoreRoles
    1	2024-04-21T12:14:44-07:00	JAVA	org.yb.pgsql.TestYsqlDump#ysqlDumpWithYbMetadata
    1	2024-04-21T12:15:24-07:00	JAVA	org.yb.pgsql.TestYsqlDump#ysqlDumpWithoutYbMetadata
    1	2024-04-21T12:16:21-07:00	JAVA	org.yb.pgsql.TestYsqlDump#ysqlDumpAllWithoutYbMetadata
    1	2024-04-21T12:17:18-07:00	JAVA	org.yb.pgsql.TestYsqlDump#ysqlDumpAllWithYbMetadata
    1	2024-04-21T12:18:19-07:00	JAVA	org.yb.pgsql.TestYsqlDump#ysqlDumpLegacyColocatedDB
    1	2024-04-21T12:19:09-07:00	JAVA	org.yb.pgsql.TestYsqlDump#ysqlDumpColocatedDB
    1	2024-04-21T12:19:29-07:00	JAVA	org.yb.pgsql.TestYbBackup#testExtensionBackupUsingTestExtension
    0	2024-04-21T12:20:42-07:00	JAVA	org.yb.pgsql.TestYbBackup#testIgnoreExistingTablespaces
    0	2024-04-21T12:20:59-07:00	pgwrapper_pg_wait_on_conflict-test	PgWaitQueuesTest.TestMultipleRequestsPerTxn
    0	2024-04-21T12:21:36-07:00	integration-tests_cdcsdk_ysql-test	CDCSDKYsqlTest.TestAtomicDDLDropColumn
    0	2024-04-21T12:22:04-07:00	integration-tests_xcluster_ysql-test	XClusterYsqlTest.DmlOperationsBlockedOnStandbyCluster
    0	2024-04-21T12:27:51-07:00	integration-tests_wait_states-itest	*
    0	2024-04-21T12:28:19-07:00	pgwrapper_pg_ash-test	PgAshTest.*
    0	2024-04-21T12:39:33-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.*
    1	2024-04-21T12:45:31-07:00	JAVA	org.yb.pgsql.TestPgRegressPlanner
    0	2024-04-21T12:45:46-07:00	client_snapshot-schedule-test	CloneFromScheduleTest.Clone
    0	2024-04-21T12:46:21-07:00	integration-tests_minicluster-snapshot-test	PgCloneTest.Clone
    8	2024-04-21T13:07:35-07:00	pgwrapper_pg_catalog_version-test	*

Almalinux 8, release, clang17, get the following results:

    0	2024-04-21T13:26:49-07:00	pgwrapper_pg_index_backfill-test	PgIndexBackfillTest.GinStress

Jenkins: rebase: pg15

Reviewers: aagrawal, tfoucher, xCluster, hsunder

Reviewed By: tfoucher

Subscribers: ybase, ycdcxcluster, yql

Differential Revision: https://phorge.dev.yugabyte.com/D34352
  • Loading branch information
jaki committed Apr 23, 2024
2 parents 07a4075 + ee08bd6 commit 8d7632e
Show file tree
Hide file tree
Showing 924 changed files with 44,518 additions and 13,147 deletions.
3 changes: 2 additions & 1 deletion .arclint
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"(^troubleshoot/backend/src/test/resources/query/.*)",
"(^managed/src/main/resources/openapi/)",
"(^managed/src/main/resources/openapi_templates/)",
"(^yb_release_manifest.json$)"
"(^yb_release_manifest.json$)",
"(^managed/client/java/.*/pom.xml)"
],
"linters": {
"script-and-regex.script": {
Expand Down
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
Expand Down
4 changes: 4 additions & 0 deletions .github/vale-styles/Yugabyte/spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ backport
backported
backporting
backports
backquote
backtrace
backtraced
backtraces
Expand Down Expand Up @@ -138,6 +139,7 @@ crosslinked
crosslinking
crosslinks
Crossplane
crosstab
CrowdIn
CSV
Cutover
Expand Down Expand Up @@ -878,6 +880,8 @@ YBase
ycqlsh
YouTrack
ysqlsh
ysql_dump
ysql_dumpall
ytt
Yubico
Yugabyte
Expand Down
445 changes: 325 additions & 120 deletions bin/yugabyted

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions build-support/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,20 @@ export NO_REBUILD_THIRDPARTY=1
THIRDPARTY_BIN=$YB_SRC_ROOT/thirdparty/installed/bin
export PPROF_PATH=$THIRDPARTY_BIN/pprof

# Configure the build
#
# Check for available YBC
ybc_tar=$(find /opt/yb-build/ybc/ -type f | sort -V | tail -1)
ybc_dest="$YB_SRC_ROOT/build/ybc"
if [[ -n ${ybc_tar} ]]; then
log "Unpacking ${ybc_tar} binaries to ${ybc_dest}/"
log " and setting YB_TEST_YB_CONTROLLER=1"
mkdir -p "${ybc_dest}"
tar xf "$ybc_tar"
cp ./ybc-*/bin/* "${ybc_dest}/"
( set -x; ls -l "${ybc_dest}/")
export YB_TEST_YB_CONTROLLER=1
else
log "Did not find YBC tarfile. Not setting YB_TEST_YB_CONTROLLER."
fi

cd "$BUILD_ROOT"

Expand Down
14 changes: 12 additions & 2 deletions docs/assets/scss/_dropdown_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
&:hover {
background: #f2f6ff !important;
}

&[role="button"] {
cursor: not-allowed;
opacity: 0.6;

&:hover {
background: #fff !important;
}
}
}
}

Expand All @@ -47,7 +56,7 @@
border-radius: 8px;
min-height: 32px;

> span {
>span {
font-weight: 500;
font-size: 10px;
line-height: 16px;
Expand Down Expand Up @@ -100,13 +109,14 @@

.dropdown-menu {
width: 100%;
transform:translate3d(0px, 38px, 0px)!important;
transform: translate3d(0px, 38px, 0px) !important;
}
}

@media (min-width: 992px) {
display: none;
}

@media (max-width: 991px) and (min-width: 768px) {
margin-top: 18px;
width: calc(100% - 85px);
Expand Down
21 changes: 20 additions & 1 deletion docs/config/_default/menus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
url = "/preview/yugabyte-cloud/"
[home.params]
showSection = true
hideChildren = true

[[home]]
name = "YugabyteDB Voyager"
Expand All @@ -367,6 +368,7 @@
url = "/preview/yugabyte-voyager/"
[home.params]
showSection = true
hideChildren = true

########## Menus for preview

Expand Down Expand Up @@ -561,7 +563,7 @@
parent = "integrations"

[[preview_integrations]]
name = "Platforms (HW, SW, Data Management)"
name = "Infrastructure (HW, SW, Data Mgmt)"
weight = 12
identifier = "integrations-platforms"
parent = "integrations"
Expand Down Expand Up @@ -727,6 +729,23 @@
weight = 5
identifier = "yba-releases"
url = "/preview/releases/yba-releases/"
[preview_releases.params]
classes = "separator"
showSection = true

[[preview_releases]]
name = "YugabyteDB Managed"
weight = 6
identifier = "ybm-releases"
url = "/preview/yugabyte-cloud/release-notes/"
[preview_releases.params]
showSection = true

[[preview_releases]]
name = "YugabyteDB Voyager"
weight = 7
identifier = "voy-releases"
url = "/preview/yugabyte-voyager/release-notes/"
[preview_releases.params]
showSection = true

Expand Down
2 changes: 1 addition & 1 deletion docs/content/preview/admin/yb-ctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ For details and examples, see [Create a local cluster with custom flags](#create

**Example**

To enable [YSQL authentication](../../secure/enable-authentication/ysql/), you can use the `--tserver_flags` flag to add the `yb-tserver` [`--ysql_enable-auth`](../yb-tserver/#ysql-enable-auth) flag to the `yb-ctl create | start | restart` commands.
To enable [YSQL authentication](../../secure/enable-authentication/ysql/), you can use the `--tserver_flags` flag to add the `yb-tserver` [`--ysql_enable_auth`](../yb-tserver/#ysql-enable-auth) flag to the `yb-ctl create | start | restart` commands.

```sh
$./bin/yb-ctl create --tserver_flags "ysql_enable_auth=true"
Expand Down
13 changes: 6 additions & 7 deletions docs/content/preview/admin/yb-ts-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ yb-ts-cli [ --server_address=<host>:<port> ] compact_tablet <tablet_id>

##### count_intents

Print the count of uncommitted intents (or [provisional records](../../../architecture/transactions/distributed-txns/#provisional-records)). Useful for debugging transactional workloads.
Print the count of uncommitted intents (or [provisional records](../../architecture/transactions/distributed-txns/#provisional-records)). Helpful for debugging transactional workloads.

**Syntax**

Expand All @@ -118,7 +118,7 @@ yb-ts-cli [ --server_address=<host>:<port> ] count_intents

##### current_hybrid_time

Prints the value of the current [hybrid time](../../../architecture/transactions/single-row-transactions/#hybrid-time-as-an-mvcc-timestamp).
Prints the value of the current [hybrid time](../../architecture/transactions/transactions-overview/#mvcc-using-hybrid-time).

**Syntax**

Expand All @@ -140,7 +140,7 @@ yb-ts-cli [ --server_address=<host>:<port> ] delete_tablet <tablet_id> "<reason

* *host*:*port*: The *host* and *port* of the tablet server. Default is `localhost:9100`.
* *tablet_id*: The identifier (ID) for the tablet.
* *reason-string*: Text string providing useful information on why the tablet was deleted.
* *reason-string*: Text string providing information on why the tablet was deleted.

##### dump_tablet

Expand Down Expand Up @@ -232,14 +232,14 @@ yb-ts-cli [ --server_address=<host>:<port> ] set_flag [ --force ] <flag> <value>

* *host*:*port*: The *host* and *port* of the tablet server. Default is `localhost:9100`.
* `--force`: Flag to allow a change to a flag that is not explicitly marked as runtime-settable. Note that the change may be ignored on the server or may cause the server to crash, if unsafe values are provided. See [--force](#force).
* *flag*: The `yb-tserver` configuration flag (without the `--` prefix) to be set. See [`yb-tserver`](../../reference/configuration/yb-tserver/#configuration-flags)
* *flag*: The `yb-tserver` configuration flag (without the `--` prefix) to be set. See [`yb-tserver`](../../reference/configuration/yb-tserver/)
* *value*: The value to be applied.

{{< note title="Important" >}}

The `set_flag` command changes the in-memory value of the specified flag, atomically, for a running server and can alter its behavior. **The change does NOT persist across restarts.**

In practice, there are some flags that are runtime safe to change (runtime-settable) and some that are not. For example, the bind address of the server cannot be changed at runtime, since the server binds just once at startup. While most of the flags are probably runtime-settable, you need to review the flags and note in the configuration pages which flags are not runtime-settable. (See GitHub issue [#3534](https://github.com/yugabyte/yugabyte-db/issues/3534)).
In practice, there are some flags that are runtime safe to change (runtime-settable) and some that are not. For example, the bind address of the server cannot be changed at runtime, because the server binds just once at startup. While most of the flags are probably runtime-settable, you need to review the flags and note in the configuration pages which flags are not runtime-settable. (See GitHub issue [#3534](https://github.com/yugabyte/yugabyte-db/issues/3534)).

One typical operational flow is that you can use this to modify runtime flags in memory and then out of band also modify the configuration file that the server uses to start. This allows for flags to be changed on running servers, without executing a restart of the server.

Expand All @@ -261,7 +261,7 @@ For an example, see [Return the status of a tablet server](#return-the-status-of

##### refresh_flags

Refresh flags that are loaded from the configuration file. Works on both YB-Master (port 9100) and YB-TServer (port 7100) process. No parameters needed.
Refresh flags that are loaded from the configuration file. Works on both YB-Master (port 9100) and YB-TServer (port 7100) process. No parameters needed.

Each process needs to have the following command issued, for example, issuing the command on one YB-TServer won't update the flags on the other YB-TServers.

Expand Down Expand Up @@ -301,7 +301,6 @@ To connect to a cluster with TLS enabled, you must include the `--certs_dir_name

Default: `""`


## Examples

### Return the status of a tablet server
Expand Down
2 changes: 1 addition & 1 deletion docs/content/preview/admin/ycqlsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ycqlsh [flags] [host [port]]
Where
- `host` is the IP address of the host on which [YB-TServer](../../architecture/concepts/universe/#yb-tserver-process) is run. The default is local host at `127.0.0.1`.
- `host` is the IP address of the host on which [YB-TServer](../../architecture/concepts/universe/#component-services) is run. The default is local host at `127.0.0.1`.
- `port` is the TCP port at which YB-TServer listens for YCQL connections. The default is `9042`.
### Example
Expand Down
10 changes: 5 additions & 5 deletions docs/content/preview/admin/ysql-dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ysql_dump is a utility for backing up a YugabyteDB database into a plain-text, S

ysql_dump only dumps a single database. To backup global objects that are common to all databases in a cluster, such as roles, use [ysql_dumpall](../ysql-dumpall/).

Dumps are output in plain-text, SQL script files. Script dumps are plain-text files containing the SQL statements required to reconstruct the database to the state it was in at the time it was saved. To restore from such a script, import it using the [`ysqlsh \i`](../ysqlsh-meta-commands/#-i-filename-include-filename) meta-command. Script files can be used to reconstruct the database even on other machines and other architectures; with some modifications, even on other SQL database products.
Dumps are output in plain-text, SQL script files. Script dumps are plain-text files containing the SQL statements required to reconstruct the database to the state it was in at the time it was saved. To restore from such a script, import it using the [`ysqlsh \i`](../ysqlsh-meta-commands/#i-filename-include-filename) meta-command. Script files can be used to reconstruct the database even on other machines and other architectures; with some modifications, even on other SQL database products.

While running ysql_dump, you should examine the output for any warnings (printed on standard error).

Expand Down Expand Up @@ -120,7 +120,7 @@ Dump only the object definitions (schema), not data.

This option is the inverse of [`-a|--data-only`](#a-data-only).

(Do not confuse this with the [`-n|--schema`](#n-schema-schema-schema) option, which uses the word schema in a different meaning.)
(Do not confuse this with the [`-n|--schema`](#n-schema-schema-schema) option, which uses the word "schema" in a different meaning.)

To exclude table data for only a subset of tables in the database, see [`--exclude-table-data`](#exclude-table-data).

Expand All @@ -142,9 +142,9 @@ When `-t|--table` is specified, ysql_dump makes no attempt to dump any other dat

#### -T *table*, --exclude-table=*table*

Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for [`-t`](#t-table). [`-T|--exclude-table`](#T-table-exclude-table-table) can be given more than once to exclude tables matching any of several patterns.
Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for [`-t`](#t-table-table-table). `-T|--exclude-table` can be given more than once to exclude tables matching any of several patterns.

When both [`-t|--table`](#t-table-table-table) and `-T|--exclude-table` are given, the behavior is to dump just the tables that match at least one [`-t|--table`](#t-table-table-table) option but no `-T|--exclude-table` options. If `-T|--exclude-table` appears without `-t|--table`, then tables matching `-T|--exclude-table` are excluded from what is otherwise a normal dump.
When both `-t|--table` and `-T|--exclude-table` are given, the behavior is to dump just the tables that match at least one `-t|--table` option but no `-T|--exclude-table` options. If `-T|--exclude-table` appears without `-t|--table`, then tables matching `-T|--exclude-table` are excluded from what is otherwise a normal dump.

#### -v, --verbose

Expand Down Expand Up @@ -288,7 +288,7 @@ This option is never essential, as ysql_dump automatically prompts for a passwor

#### --role=*rolename*

Specifies a role name to be used to create the dump. This option causes ysql_dump to issue a `SET ROLE <rolename>` statement after connecting to the database. It is useful when the authenticated user (specified by [`-U|--username`](#u-username)) lacks privileges needed by ysql_dump, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.
Specifies a role name to be used to create the dump. This option causes ysql_dump to issue a `SET ROLE <rolename>` statement after connecting to the database. It is useful when the authenticated user (specified by [`-U|--username`](#u-username-username-username)) lacks privileges needed by ysql_dump, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.

## Environment

Expand Down
10 changes: 5 additions & 5 deletions docs/content/preview/admin/ysql-dumpall.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type: docs

## Overview

ysql_dumpall is a utility for writing out (dumping) all YugabyteDB databases of a cluster into one plain-text, SQL script file. The script file contains SQL statements that can be used as input to `ysqlsh` to restore the databases. It does this by calling [ysql_dump](../ysql-dump/) for each database in the YugabyteDB cluster. ysql_dumpall also dumps global objects that are common to all databases, such as database roles. (ysql_dump does not export roles.)
ysql_dumpall is a utility for writing out ("dumping") all YugabyteDB databases of a cluster into one plain-text, SQL script file. The script file contains SQL statements that can be used as input to `ysqlsh` to restore the databases. It does this by calling [ysql_dump](../ysql-dump/) for each database in the YugabyteDB cluster. ysql_dumpall also dumps global objects that are common to all databases, such as database roles. (ysql_dump does not export roles.)

Because ysql_dumpall reads tables from all databases, you will most likely have to connect as a database superuser in order to produce a complete dump. Also, you will need superuser privileges to execute the saved script in order to be allowed to add roles and create databases.

The SQL script will be written to the standard output. Use the [`-f|--file`](#f-file-filename) option or shell operators to redirect it into a file.
The SQL script will be written to the standard output. Use the [`-f|--file`](#f-filename-file-filename) option or shell operators to redirect it into a file.

ysql_dumpall needs to connect multiple times (once per database) to the YugabyteDB cluster. If you use password authentication, it will ask for a password each time. It is convenient to have a `~/.pgpass` file in such cases.

Expand Down Expand Up @@ -173,7 +173,7 @@ The following command line options control the database connection parameters.

Specifies parameters used to connect to the server, as a connection string.

The option is called `-d|--dbname` for consistency with other client applications, but because ysql_dumpall needs to connect to many databases, the database name in the connection string will be ignored. Use the [`-l|--database`](#l-database-database) option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.
The option is called `-d|--dbname` for consistency with other client applications, but because ysql_dumpall needs to connect to many databases, the database name in the connection string will be ignored. Use the [`-l|--database`](#l-dbname-database-database) option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.

#### -h *host*, --host *host*

Expand All @@ -193,7 +193,7 @@ The username to connect as.

#### -w, --no-password

Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a `~/.pgpass` file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a `~/.pgpass` file, the connection attempt will fail. This option can be helpful in batch jobs and scripts where no user is present to enter a password.

#### -W, --password

Expand All @@ -209,7 +209,7 @@ For each database to be dumped, a password prompt will occur. To avoid having to

#### --role=*rolename*

Specifies a role name to be used to create the dump. This option causes ysql_dumpall to issue a `SET ROLE <rolename>` statement after connecting to the database. It is helpful when the authenticated user (specified by [`-U|--username`](#u-username-username)) lacks privileges needed by ysql_dumpall, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.
Specifies a role name to be used to create the dump. This option causes ysql_dumpall to issue a `SET ROLE <rolename>` statement after connecting to the database. It is helpful when the authenticated user (specified by [`-U|--username`](#u-username-username-username)) lacks privileges needed by ysql_dumpall, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.

## Environment

Expand Down
4 changes: 2 additions & 2 deletions docs/content/preview/admin/ysqlsh-meta-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Unlike most other meta-commands, the entire remainder of the line is always take

##### \f [ string ]

Sets the field separator for unaligned query output. The default is the vertical bar (`|`). It is equivalent to [\pset fieldsep](../ysqlsh-pset-options/#pset-option-value).
Sets the field separator for unaligned query output. The default is the vertical bar (`|`). It is equivalent to [\pset fieldsep](../ysqlsh-pset-options/#fieldsep).

##### \g [ filename ], \g [ |command ]

Expand Down Expand Up @@ -553,7 +553,7 @@ Sets options affecting the output of query result tables. *option* indicates whi

`\pset` without any arguments displays the current status of all printing options.

The *options* are defined in [pset options](../ysqlsh-pset-options/#pset-options).
The *options* are defined in [pset options](../ysqlsh-pset-options/).

For examples using `\pset`, see [ysqlsh meta-command examples](../ysqlsh-meta-examples/).

Expand Down
2 changes: 1 addition & 1 deletion docs/content/preview/admin/ysqlsh-meta-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ SELECT t1.first as "A", t2.first+100 AS "B", t1.first*(t2.first+100) as "AxB",

## pset

You can display tables in different ways by using the [`\pset`](../ysqlsh-pset-options/#pset-option-value) command:
You can display tables in different ways by using the [`\pset`](../ysqlsh-pset-options/) command:

```sql
\pset border 2
Expand Down
2 changes: 1 addition & 1 deletion docs/content/preview/admin/ysqlsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Turn on HTML tabular output. This is equivalent to [\pset format html](../ysqlsh
##### -l, --list
List all available databases, then exit. Other non-connection options are ignored. This is similar to the meta-command [`\list`](../ysqlsh-meta-commands/#l-list-pattern).
List all available databases, then exit. Other non-connection options are ignored. This is similar to the meta-command [`\list`](../ysqlsh-meta-commands/#l-list-pattern-patterns).
When this option is used, ysqlsh connects to the database `yugabyte`, unless a different database is named on the command line (flag `-d` or non-option argument, possibly using a service entry, but not using an environment variable).
Expand Down
Loading

0 comments on commit 8d7632e

Please sign in to comment.