Skip to content

[PBCKP-256] remove src/backend/utils/hash/pg_crc.c borrowing #524

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

Merged
merged 9 commits into from
Oct 15, 2022
Prev Previous commit
Next Next commit
[PBCKP-232] remove depricated options (master-db, master-host, master…
…-port, master-user, replica-timeout) part 1
  • Loading branch information
kulaginm committed Jul 20, 2022
commit 5ed469d500969be554bdc906ecfd3cb368d8372d
54 changes: 0 additions & 54 deletions src/configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,6 @@ ConfigOption instance_options[] =
&instance_config.conn_opt.pguser, SOURCE_CMD, 0,
OPTION_CONN_GROUP, 0, option_get_value
},
/* Replica options */
{
's', 202, "master-db",
&instance_config.master_conn_opt.pgdatabase, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
's', 203, "master-host",
&instance_config.master_conn_opt.pghost, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
's', 204, "master-port",
&instance_config.master_conn_opt.pgport, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
's', 205, "master-user",
&instance_config.master_conn_opt.pguser, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
'u', 206, "replica-timeout",
&instance_config.replica_timeout, SOURCE_CMD, SOURCE_DEFAULT,
OPTION_REPLICA_GROUP, OPTION_UNIT_S, option_get_value
},
/* Archive options */
{
'u', 207, "archive-timeout",
Expand Down Expand Up @@ -362,8 +336,6 @@ init_config(InstanceConfig *config, const char *instance_name)
config->xlog_seg_size = XLOG_SEG_SIZE;
#endif

config->replica_timeout = REPLICA_TIMEOUT_DEFAULT;

config->archive_timeout = ARCHIVE_TIMEOUT_DEFAULT;

/* Copy logger defaults */
Expand Down Expand Up @@ -437,32 +409,6 @@ readInstanceConfigFile(InstanceState *instanceState)
&instance->conn_opt.pguser, SOURCE_CMD, 0,
OPTION_CONN_GROUP, 0, option_get_value
},
/* Replica options */
{
's', 202, "master-db",
&instance->master_conn_opt.pgdatabase, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
's', 203, "master-host",
&instance->master_conn_opt.pghost, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
's', 204, "master-port",
&instance->master_conn_opt.pgport, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
's', 205, "master-user",
&instance->master_conn_opt.pguser, SOURCE_CMD, 0,
OPTION_REPLICA_GROUP, 0, option_get_value
},
{
'u', 206, "replica-timeout",
&instance->replica_timeout, SOURCE_CMD, SOURCE_DEFAULT,
OPTION_REPLICA_GROUP, OPTION_UNIT_S, option_get_value
},
/* Archive options */
{
'u', 207, "archive-timeout",
Expand Down
16 changes: 1 addition & 15 deletions src/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* help.c
*
* Copyright (c) 2017-2021, Postgres Professional
* Copyright (c) 2017-2022, Postgres Professional
*
*-------------------------------------------------------------------------
*/
Expand Down Expand Up @@ -416,13 +416,6 @@ help_backup(void)
printf(_(" --remote-user=username user name for ssh connection (default: current user)\n"));
printf(_(" --ssh-options=ssh_options additional ssh options (default: none)\n"));
printf(_(" (example: --ssh-options='-c cipher_spec -F configfile')\n"));

printf(_("\n Replica options:\n"));
printf(_(" --master-user=user_name user name to connect to master (deprecated)\n"));
printf(_(" --master-db=db_name database to connect to master (deprecated)\n"));
printf(_(" --master-host=host_name database server host of master (deprecated)\n"));
printf(_(" --master-port=port database server port of master (deprecated)\n"));
printf(_(" --replica-timeout=timeout wait timeout for WAL segment streaming through replication (deprecated)\n\n"));
}

static void
Expand Down Expand Up @@ -878,13 +871,6 @@ help_set_config(void)
printf(_(" --archive-host=destination address or hostname for ssh connection to archive host\n"));
printf(_(" --archive-port=port port for ssh connection to archive host (default: 22)\n"));
printf(_(" --archive-user=username user name for ssh connection to archive host (default: PostgreSQL user)\n"));

printf(_("\n Replica options:\n"));
printf(_(" --master-user=user_name user name to connect to master (deprecated)\n"));
printf(_(" --master-db=db_name database to connect to master (deprecated)\n"));
printf(_(" --master-host=host_name database server host of master (deprecated)\n"));
printf(_(" --master-port=port database server port of master (deprecated)\n"));
printf(_(" --replica-timeout=timeout wait timeout for WAL segment streaming through replication (deprecated)\n\n"));
}

static void
Expand Down
3 changes: 0 additions & 3 deletions src/pg_probackup.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,6 @@ typedef struct InstanceConfig
char *external_dir_str;

ConnectionOptions conn_opt;
ConnectionOptions master_conn_opt;

uint32 replica_timeout; //Deprecated. Not used anywhere

/* Wait timeout for WAL segment archiving */
uint32 archive_timeout;
Expand Down
9 changes: 0 additions & 9 deletions tests/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,6 @@ def test_replica_archive(self):
backup_dir, 'replica', replica,
options=[
'--archive-timeout=30',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port),
'--stream'])

self.validate_pb(backup_dir, 'replica')
Expand Down Expand Up @@ -764,9 +761,6 @@ def test_replica_archive(self):
replica, backup_type='page',
options=[
'--archive-timeout=60',
'--master-db=postgres',
'--master-host=localhost',
'--master-port={0}'.format(master.port),
'--stream'])

self.validate_pb(backup_dir, 'replica')
Expand Down Expand Up @@ -857,9 +851,6 @@ def test_master_and_replica_parallel_archiving(self):
backup_dir, 'replica', replica,
options=[
'--archive-timeout=30',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port),
'--stream'])

self.validate_pb(backup_dir, 'replica')
Expand Down
102 changes: 16 additions & 86 deletions tests/ptrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,13 +1560,7 @@ def test_create_db_on_replica(self):

self.backup_node(
backup_dir, 'replica', replica,
options=[
'-j10',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(node.port),
'--stream'
]
options=['-j10', '--stream']
)

# CREATE DATABASE DB1
Expand All @@ -1584,13 +1578,7 @@ def test_create_db_on_replica(self):
backup_id = self.backup_node(
backup_dir, 'replica',
replica, backup_type='ptrack',
options=[
'-j10',
'--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(node.port)
]
options=['-j10', '--stream']
)

if self.paranoia:
Expand Down Expand Up @@ -2304,11 +2292,7 @@ def test_ptrack_clean_replica(self):
backup_dir,
'replica',
replica,
options=[
'-j10', '--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)])
options=['-j10', '--stream'])
master.safe_psql('postgres', 'checkpoint')

for i in idx_ptrack:
Expand All @@ -2335,11 +2319,7 @@ def test_ptrack_clean_replica(self):
'replica',
replica,
backup_type='ptrack',
options=[
'-j10', '--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)])
options=['-j10', '--stream'])
master.safe_psql('postgres', 'checkpoint')

for i in idx_ptrack:
Expand Down Expand Up @@ -2367,11 +2347,7 @@ def test_ptrack_clean_replica(self):
'replica',
replica,
backup_type='page',
options=[
'-j10', '--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port),
'--stream'])
options=['-j10', '--stream'])
master.safe_psql('postgres', 'checkpoint')

for i in idx_ptrack:
Expand Down Expand Up @@ -2437,8 +2413,7 @@ def test_ptrack_cluster_on_btree(self):
idx_ptrack[i]['old_pages'] = self.get_md5_per_page_for_fork(
idx_ptrack[i]['path'], idx_ptrack[i]['old_size'])

self.backup_node(
backup_dir, 'node', node, options=['-j10', '--stream'])
self.backup_node(backup_dir, 'node', node, options=['-j10', '--stream'])

node.safe_psql('postgres', 'delete from t_heap where id%2 = 1')
node.safe_psql('postgres', 'cluster t_heap using t_btree')
Expand Down Expand Up @@ -2573,11 +2548,7 @@ def test_ptrack_cluster_on_btree_replica(self):
master.safe_psql('postgres', 'vacuum t_heap')
master.safe_psql('postgres', 'checkpoint')

self.backup_node(
backup_dir, 'replica', replica, options=[
'-j10', '--stream', '--master-host=localhost',
'--master-db=postgres', '--master-port={0}'.format(
master.port)])
self.backup_node(backup_dir, 'replica', replica, options=['-j10', '--stream'])

for i in idx_ptrack:
# get size of heap and indexes. size calculated in pages
Expand Down Expand Up @@ -2674,9 +2645,7 @@ def test_ptrack_cluster_on_gist_replica(self):

self.backup_node(
backup_dir, 'replica', replica, options=[
'-j10', '--stream', '--master-host=localhost',
'--master-db=postgres', '--master-port={0}'.format(
master.port)])
'-j10', '--stream'])

for i in idx_ptrack:
# get size of heap and indexes. size calculated in pages
Expand Down Expand Up @@ -2844,11 +2813,7 @@ def test_ptrack_empty_replica(self):
backup_dir,
'replica',
replica,
options=[
'-j10', '--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)])
options=['-j10', '--stream'])

# Create indexes
for i in idx_ptrack:
Expand All @@ -2868,11 +2833,7 @@ def test_ptrack_empty_replica(self):
'replica',
replica,
backup_type='ptrack',
options=[
'-j1', '--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)])
options=['-j1', '--stream'])

if self.paranoia:
pgdata = self.pgdata_content(replica.data_dir)
Expand Down Expand Up @@ -3041,12 +3002,7 @@ def test_basic_ptrack_truncate_replica(self):
# Make backup to clean every ptrack
self.backup_node(
backup_dir, 'replica', replica,
options=[
'-j10',
'--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)])
options=['-j10', '--stream'])

if replica.major_version < 11:
for i in idx_ptrack:
Expand All @@ -3070,12 +3026,7 @@ def test_basic_ptrack_truncate_replica(self):

self.backup_node(
backup_dir, 'replica', replica, backup_type='ptrack',
options=[
'-j10',
'--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)])
options=['-j10', '--stream'])

pgdata = self.pgdata_content(replica.data_dir)

Expand Down Expand Up @@ -3245,12 +3196,7 @@ def test_ptrack_vacuum_replica(self):
replica.safe_psql('postgres', 'checkpoint')

# Make FULL backup to clean every ptrack
self.backup_node(
backup_dir, 'replica', replica, options=[
'-j10', '--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port),
'--stream'])
self.backup_node(backup_dir, 'replica', replica, options=['-j10', '--stream'])

if replica.major_version < 11:
for i in idx_ptrack:
Expand Down Expand Up @@ -3430,12 +3376,7 @@ def test_ptrack_vacuum_bits_frozen_replica(self):
# Take backup to clean every ptrack
self.backup_node(
backup_dir, 'replica', replica,
options=[
'-j10',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port),
'--stream'])
options=['-j10', '--stream'])

if replica.major_version < 11:
for i in idx_ptrack:
Expand Down Expand Up @@ -3688,12 +3629,7 @@ def test_ptrack_vacuum_full_replica(self):
# Take FULL backup to clean every ptrack
self.backup_node(
backup_dir, 'replica', replica,
options=[
'-j10',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port),
'--stream'])
options=['-j10', '--stream'])

if replica.major_version < 11:
for i in idx_ptrack:
Expand Down Expand Up @@ -3860,13 +3796,7 @@ def test_ptrack_vacuum_truncate_replica(self):
# Take FULL backup to clean every ptrack
self.backup_node(
backup_dir, 'replica', replica,
options=[
'-j10',
'--stream',
'--master-host=localhost',
'--master-db=postgres',
'--master-port={0}'.format(master.port)
]
options=['-j10', '--stream']
)

if master.major_version < 11:
Expand Down
Loading