MCPcopy Create free account
hub / github.com/apache/cloudberry / SendBaseBackup

Function SendBaseBackup

src/backend/replication/basebackup.c:1072–1097  ·  view source on GitHub ↗

* SendBaseBackup() - send a complete base backup. * * The function will put the system into backup mode like pg_start_backup() * does, so that the backup is consistent even though we read directly from * the filesystem, bypassing the buffer cache. */

Source from the content-addressed store, hash-verified

1070 * the filesystem, bypassing the buffer cache.
1071 */
1072void
1073SendBaseBackup(BaseBackupCmd *cmd)
1074{
1075 basebackup_options opt;
1076 SessionBackupState status = get_backup_status();
1077
1078 if (status == SESSION_BACKUP_NON_EXCLUSIVE)
1079 ereport(ERROR,
1080 (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1081 errmsg("a backup is already in progress in this session")));
1082
1083 parse_basebackup_options(cmd->options, &opt);
1084
1085 WalSndSetState(WALSNDSTATE_BACKUP);
1086
1087 if (update_process_title)
1088 {
1089 char activitymsg[50];
1090
1091 snprintf(activitymsg, sizeof(activitymsg), "sending backup \"%s\"",
1092 opt.label);
1093 set_ps_display(activitymsg);
1094 }
1095
1096 perform_base_backup(&opt);
1097}
1098
1099static void
1100send_int8_string(StringInfoData *buf, int64 intval)

Callers 1

exec_replication_commandFunction · 0.85

Calls 7

get_backup_statusFunction · 0.85
parse_basebackup_optionsFunction · 0.85
WalSndSetStateFunction · 0.85
set_ps_displayFunction · 0.85
perform_base_backupFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected