@@ -30,10 +30,10 @@ static int get_wal_file_internal(const char *from_path, const char *to_path, FIL
30
30
#ifdef HAVE_LIBZ
31
31
static const char * get_gz_error (gzFile gzf ,int errnum );
32
32
#endif
33
- // static void copy_file_attributes(const char *from_path,
34
- // fio_location from_location,
35
- // const char *to_path, fio_location to_location,
36
- // bool unlink_on_error);
33
+ //static void copy_file_attributes(const char *from_path,
34
+ // fio_location from_location,
35
+ // const char *to_path, fio_location to_location,
36
+ // bool unlink_on_error);
37
37
38
38
static bool next_wal_segment_exists (TimeLineID tli ,XLogSegNo segno ,const char * prefetch_dir ,uint32 wal_seg_size );
39
39
static uint32 run_wal_prefetch (const char * prefetch_dir ,const char * archive_dir ,TimeLineID tli ,
@@ -120,6 +120,7 @@ do_archive_push(InstanceState *instanceState, InstanceConfig *instance, char *wa
120
120
uint64 i ;
121
121
char current_dir [MAXPGPATH ];
122
122
char pg_xlog_dir [MAXPGPATH ];
123
+ char xlog_wal_path [MAXPGPATH ];
123
124
char archive_status_dir [MAXPGPATH ];
124
125
uint64 system_id ;
125
126
bool is_compress = false;
@@ -141,23 +142,21 @@ do_archive_push(InstanceState *instanceState, InstanceConfig *instance, char *wa
141
142
parray * batch_files = NULL ;
142
143
int n_threads ;
143
144
144
- char xlog_wal_path [MAXPGPATH ];
145
-
146
145
if (wal_file_name == NULL )
147
146
elog (ERROR ,"Required parameter is not specified: --wal-file-name %%f" );
148
147
149
148
join_path_components (xlog_wal_path ,PG_XLOG_DIR ,wal_file_name );
150
149
151
150
if (wal_file_path == NULL )
152
151
{
153
- elog (INFO ,"Required parameter is not specified: --wal_file_path %%p "
152
+ elog (INFO ,"Optional parameter is not specified: --wal_file_path %%p "
154
153
"Setting wal-file-path by default" );
155
154
wal_file_path = xlog_wal_path ;
156
155
}
157
156
158
- if (strcmp (wal_file_path ,xlog_wal_path )!= 0 )
157
+ if (strcmp (wal_file_path ,xlog_wal_path )!= 0 )
159
158
{
160
- elog (INFO ,"wal_file_path is setted by user %s" ,wal_file_path );
159
+ elog (INFO ,"wal_file_path is setted by user %s" ,wal_file_path );
161
160
162
161
join_path_components (pg_xlog_dir ,instance -> pgdata ,XLOGDIR );
163
162
}
@@ -178,7 +177,7 @@ do_archive_push(InstanceState *instanceState, InstanceConfig *instance, char *wa
178
177
if (system_id != instance -> system_identifier )
179
178
elog (ERROR ,"Refuse to push WAL segment %s into archive. Instance parameters mismatch."
180
179
"Instance '%s' should have SYSTEM_ID = " UINT64_FORMAT " instead of " UINT64_FORMAT ,
181
- wal_file_name ,instance -> name ,instance -> system_identifier ,system_id );
180
+ wal_file_name ,instanceState -> instance_name ,instance -> system_identifier ,system_id );
182
181
183
182
if (instance -> compress_alg == PGLZ_COMPRESS )
184
183
elog (ERROR ,"Cannot use pglz for WAL compression" );
@@ -927,30 +926,30 @@ get_gz_error(gzFile gzf, int errnum)
927
926
}
928
927
#endif
929
928
930
- // / * Copy file attributes */
931
- // static void
932
- // copy_file_attributes(const char *from_path, fio_location from_location,
933
- // const char *to_path, fio_location to_location,
934
- // bool unlink_on_error)
935
- // {
936
- // struct stat st;
937
-
938
- // if (fio_stat(from_path, &st, true, from_location) == -1)
939
- // {
940
- // if (unlink_on_error)
941
- // fio_unlink(to_path, to_location);
942
- // elog(ERROR, "Cannot stat file \"%s\": %s",
943
- // from_path, strerror(errno));
944
- // }
945
-
946
- // if (fio_chmod(to_path, st.st_mode, to_location) == -1)
947
- // {
948
- // if (unlink_on_error)
949
- // fio_unlink(to_path, to_location);
950
- // elog(ERROR, "Cannot change mode of file \"%s\": %s",
951
- // to_path, strerror(errno));
952
- // }
953
- // }
929
+ /* Copy file attributes */
930
+ //static void
931
+ //copy_file_attributes(const char *from_path, fio_location from_location,
932
+ // const char *to_path, fio_location to_location,
933
+ // bool unlink_on_error)
934
+ //{
935
+ //struct stat st;
936
+ //
937
+ //if (fio_stat(from_path, &st, true, from_location) == -1)
938
+ //{
939
+ //if (unlink_on_error)
940
+ //fio_unlink(to_path, to_location);
941
+ //elog(ERROR, "Cannot stat file \"%s\": %s",
942
+ // from_path, strerror(errno));
943
+ //}
944
+ //
945
+ //if (fio_chmod(to_path, st.st_mode, to_location) == -1)
946
+ //{
947
+ //if (unlink_on_error)
948
+ //fio_unlink(to_path, to_location);
949
+ //elog(ERROR, "Cannot change mode of file \"%s\": %s",
950
+ // to_path, strerror(errno));
951
+ //}
952
+ //}
954
953
955
954
/* Look for files with '.ready' suffix in archive_status directory
956
955
* and pack such files into batch sized array.