Skip to content

Commit 09d07a5

Browse files
committed
revert S3 integration
1 parent 104b732 commit 09d07a5

File tree

5 files changed

+1
-129
lines changed

5 files changed

+1
-129
lines changed

Makefile

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,6 @@ include $(top_builddir)/src/Makefile.global
7676
include $(top_srcdir)/contrib/contrib-global.mk
7777
endif
7878

79-
ifndef S3_DIR
80-
ifneq ("$(wildcard $(abspath $(top_pbk_srcdir))/../s3)", "")
81-
S3_DIR = $(abspath $(CURDIR))/../s3
82-
endif
83-
endif
84-
85-
ifdef S3_DIR
86-
LDFLAGS += -lcurl
87-
CFLAGS += $(shell pkg-config --cflags libxml-2.0) -DPBCKP_S3=1
88-
LDFLAGS += $(shell pkg-config --libs libxml-2.0)
89-
OBJS += $(S3_DIR)/s3.o
90-
endif
91-
9279
#
9380
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -I$(top_pbk_srcdir)src -I$(BORROW_DIR)
9481
PG_CPPFLAGS += -I$(top_pbk_srcdir)src/fu_util -Wno-declaration-after-statement
@@ -100,9 +87,6 @@ PG_LIBS_INTERNAL = $(libpq_pgport) ${PTHREAD_CFLAGS}
10087

10188
# additional dependencies on borrowed files
10289
src/backup.o src/catchup.o src/pg_probackup.o: $(BORROW_DIR)/streamutil.h
103-
ifdef S3_DIR
104-
src/backup.o src/catchup.o src/pg_probackup.o: $(S3_DIR)/s3.o
105-
endif
10690
src/stream.o $(BORROW_DIR)/receivelog.o $(BORROW_DIR)/streamutil.o $(BORROW_DIR)/walmethods.o: $(BORROW_DIR)/receivelog.h
10791
$(BORROW_DIR)/receivelog.h: $(BORROW_DIR)/walmethods.h
10892

src/pg_probackup.c

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,6 @@ int64 ttl = -1;
164164
static char *expire_time_string = NULL;
165165
static pgSetBackupParams *set_backup_params = NULL;
166166

167-
#ifdef PBCKP_S3
168-
/* S3 options */
169-
S3_protocol s3_protocol;
170-
char* s3_target_bucket = NULL;
171-
#endif
172-
173167
/* ================ backupState =========== */
174168
static char *backup_id_string = NULL;
175169
pgBackup current;
@@ -180,9 +174,6 @@ static bool help_opt = false;
180174
static void opt_incr_restore_mode(ConfigOption *opt, const char *arg);
181175
static void opt_backup_mode(ConfigOption *opt, const char *arg);
182176
static void opt_show_format(ConfigOption *opt, const char *arg);
183-
#ifdef PBCKP_S3
184-
static void opt_s3_protocol(ConfigOption *opt, const char *arg);
185-
#endif
186177

187178
static void compress_init(ProbackupSubcmd const subcmd);
188179

@@ -279,12 +270,6 @@ static ConfigOption cmd_options[] =
279270
{ 'I', 170, "ttl", &ttl, SOURCE_CMD_STRICT, SOURCE_DEFAULT, 0, OPTION_UNIT_S, option_get_value},
280271
{ 's', 171, "expire-time", &expire_time_string, SOURCE_CMD_STRICT },
281272

282-
#ifdef PBCKP_S3
283-
/* S3 options */
284-
{ 'f', 245, "s3", opt_s3_protocol, SOURCE_CMD_STRICT },
285-
{ 's', 246, "target-bucket", &s3_target_bucket, SOURCE_CMD_STRICT },
286-
#endif
287-
288273
/* options for backward compatibility
289274
* TODO: remove in 3.0.0
290275
*/
@@ -974,19 +959,6 @@ main(int argc, char *argv[])
974959

975960
compress_init(backup_subcmd);
976961

977-
#ifdef PBCKP_S3
978-
if (s3_protocol != S3_INVALID_PROTOCOL)
979-
{
980-
char* s3_config_file="";
981-
read_s3_config(s3_config_file);
982-
}
983-
else
984-
{
985-
if (s3_target_bucket != NULL)
986-
elog(WARNING, "You cannot specify s3-target without using --s3 option with name of protocol");
987-
}
988-
#endif
989-
990962
/* do actual operation */
991963
switch (backup_subcmd)
992964
{
@@ -1002,10 +974,6 @@ main(int argc, char *argv[])
1002974
{
1003975
int err = 0;
1004976
err = do_add_instance(instanceState, &instance_config);
1005-
#ifdef PBCKP_S3
1006-
if (err == 0 && s3_protocol != S3_INVALID_PROTOCOL)
1007-
err = do_S3_write_config(instanceState);
1008-
#endif
1009977
return err;
1010978
}
1011979
case DELETE_INSTANCE_CMD:
@@ -1014,10 +982,6 @@ main(int argc, char *argv[])
1014982
{
1015983
int err = 0;
1016984
err = do_init(catalogState);
1017-
#ifdef PBCKP_S3
1018-
if (err == 0 && s3_protocol != S3_INVALID_PROTOCOL)
1019-
err = S3_pre_start_check(config);
1020-
#endif
1021985
return err;
1022986
}
1023987
case BACKUP_CMD:
@@ -1034,21 +998,13 @@ main(int argc, char *argv[])
1034998
elog(ERROR, "required parameter not specified: BACKUP_MODE "
1035999
"(-b, --backup-mode)");
10361000

1037-
#ifdef PBCKP_S3
1038-
if (s3_protocol != S3_INVALID_PROTOCOL)
1039-
return do_S3_backup(instanceState, set_backup_params, start_time);
1040-
#endif
10411001
return do_backup(instanceState, set_backup_params,
10421002
no_validate, no_sync, backup_logs, start_time);
10431003
}
10441004
case CATCHUP_CMD:
10451005
return do_catchup(catchup_source_pgdata, catchup_destination_pgdata, num_threads, !no_sync,
10461006
exclude_absolute_paths_list, exclude_relative_paths_list);
10471007
case RESTORE_CMD:
1048-
#ifdef PBCKP_S3
1049-
if (s3_protocol != S3_INVALID_PROTOCOL)
1050-
return do_S3_restore(instanceState, current.backup_id);
1051-
#endif
10521008
return do_restore_or_validate(instanceState, current.backup_id,
10531009
recovery_target_options,
10541010
restore_params, no_sync);
@@ -1068,10 +1024,6 @@ main(int argc, char *argv[])
10681024
restore_params,
10691025
no_sync);
10701026
case SHOW_CMD:
1071-
#ifdef PBCKP_S3
1072-
if (s3_protocol != S3_INVALID_PROTOCOL)
1073-
return do_S3_show(instanceState);
1074-
#endif
10751027
return do_show(catalogState, instanceState, current.backup_id, show_archive);
10761028
case DELETE_CMD:
10771029

@@ -1259,35 +1211,4 @@ opt_exclude_path(ConfigOption *opt, const char *arg)
12591211
opt_parser_add_to_parray_helper(&exclude_absolute_paths_list, arg);
12601212
else
12611213
opt_parser_add_to_parray_helper(&exclude_relative_paths_list, arg);
1262-
}
1263-
1264-
#ifdef PBCKP_S3
1265-
static S3_protocol
1266-
parse_s3_protocol(const char *value)
1267-
{
1268-
const char *v = value;
1269-
size_t len;
1270-
1271-
/* Skip all spaces detected */
1272-
while (IsSpace(*v))
1273-
v++;
1274-
len = strlen(v);
1275-
1276-
if (len > 0 && pg_strncasecmp("MINIO", v, len) == 0)
1277-
return S3_MINIO_PROTOCOL;
1278-
if (len > 0 && pg_strncasecmp("AWS", v, len) == 0)
1279-
return S3_AWS_PROTOCOL;
1280-
else if (len > 0 && pg_strncasecmp("GOOGLE", v, len) == 0)
1281-
return S3_GOOGLE_PROTOCOL;
1282-
else if (len > 0 && pg_strncasecmp("VK", v, len) == 0)
1283-
return S3_VK_PROTOCOL;
1284-
else
1285-
return S3_INVALID_PROTOCOL;
1286-
}
1287-
1288-
static void
1289-
opt_s3_protocol(ConfigOption *opt, const char *arg)
1290-
{
1291-
s3_protocol = parse_s3_protocol(arg);
1292-
}
1293-
#endif
1214+
}

src/pg_probackup.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343

4444
#include "pg_probackup_state.h"
4545

46-
#ifdef PBCKP_S3
47-
#include "../s3/s3.h"
48-
#endif
49-
5046
#if defined(WIN32) && !(defined(_UCRT) && defined(__MINGW64__))
5147
#error Windows port requires compilation in MinGW64 UCRT environment
5248
#endif
@@ -810,11 +806,6 @@ extern pgBackup current;
810806
/* argv of the process */
811807
extern char** commands_args;
812808

813-
#ifdef PBCKP_S3
814-
/* S3 options */
815-
extern S3_protocol s3_protocol;
816-
#endif
817-
818809
/* in backup.c */
819810
extern int do_backup(InstanceState *instanceState, pgSetBackupParams *set_backup_params,
820811
bool no_validate, bool no_sync, bool backup_logs, time_t start_time);
@@ -825,15 +816,6 @@ extern const char *deparse_backup_mode(BackupMode mode);
825816
extern void process_block_change(ForkNumber forknum, RelFileNode rnode,
826817
BlockNumber blkno);
827818

828-
#ifdef PBCKP_S3
829-
/* in s3.c */
830-
extern int do_S3_backup(InstanceState *instanceState,
831-
pgSetBackupParams *set_backup_params,time_t start_time);
832-
extern int do_S3_show(InstanceState *instanceState);
833-
extern int do_S3_restore(InstanceState *instanceState, time_t target_backup_id);
834-
extern int do_S3_write_config(InstanceState *instanceState);
835-
#endif
836-
837819
/* in catchup.c */
838820
extern int do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads, bool sync_dest_files,
839821
parray *exclude_absolute_paths_list, parray *exclude_relative_paths_list);

src/utils/file.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#include "file.h"
88
#include "storage/checksum.h"
99

10-
#ifdef PBCKP_S3
11-
#include "../s3/s3.h"
12-
#endif
13-
1410
#define PRINTF_BUF_SIZE 1024
1511

1612
static __thread unsigned long fio_fdset = 0;
@@ -3946,13 +3942,6 @@ static pioDrive_i remoteDrive;
39463942
pioDrive_i
39473943
pioDriveForLocation(fio_location loc)
39483944
{
3949-
if (loc == FIO_CLOUD_HOST)
3950-
#ifdef PBCKP_S3
3951-
return cloudDrive;
3952-
#else
3953-
elog(ERROR, "NO CLOUD DRIVE YET");
3954-
#endif
3955-
39563945
if (fio_is_remote(loc))
39573946
return remoteDrive;
39583947
else
@@ -5560,7 +5549,4 @@ init_pio_objects(void)
55605549

55615550
localDrive = bindref_pioDrive($alloc(pioLocalDrive));
55625551
remoteDrive = bindref_pioDrive($alloc(pioRemoteDrive));
5563-
#ifdef PBCKP_S3
5564-
create_pioCloudeDrive();
5565-
#endif
55665552
}

src/utils/file.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ typedef enum
9191
FIO_DB_HOST, /* data is located at Postgres server host */
9292
FIO_BACKUP_HOST, /* data is located at backup host */
9393
FIO_REMOTE_HOST, /* date is located at remote host */
94-
FIO_CLOUD_HOST /* date is located at cloud (S3) */
9594
} fio_location;
9695

9796
typedef enum pio_file_kind {

0 commit comments

Comments
 (0)