Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit71e6895

Browse files
VictorSpirinfunny-falcon
authored andcommitted
[PBCKP-270] Updated wait_wal_lsn function for begin backup without wal file for streaming WAL.
1 parent8b46c8a commit71e6895

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

‎src/backup.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,16 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
13271327
}
13281328
else
13291329
elog(LOG,"Found WAL segment: %s",wal_segment_path);
1330+
1331+
1332+
/* Check current file for stream. It may be not exist in S3 */
1333+
if (!file_exists&&segment_only&&is_start_lsn&&in_stream_dir&&try_count>1)
1334+
{
1335+
if(isStreamProccessed(wal_segment))
1336+
returnInvalidXLogRecPtr;
1337+
1338+
}
1339+
13301340
}
13311341

13321342
if (file_exists)

‎src/compatibility/receivelog.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,3 +1222,9 @@ CalculateCopyStreamSleeptime(TimestampTz now, int standby_message_timeout,
12221222

12231223
returnsleeptime;
12241224
}
1225+
1226+
1227+
boolisStreamProccessed(char*seg_filename)
1228+
{
1229+
returnstill_sending&& !strcmp(current_walfile_name,seg_filename);
1230+
}

‎src/compatibility/walmethods.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ struct WalWriteMethod
8585

8686
/* Return a text for the last error in this Walfile */
8787
constchar*(*getlasterror) (void);
88+
8889
};
8990

9091
/*

‎src/pg_probackup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,7 @@ extern XLogRecPtr wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr lsn, bool
12211221
externvoidwait_wal_and_calculate_stop_lsn(constchar*xlog_path,XLogRecPtrstop_lsn,pgBackup*backup);
12221222
externint64calculate_datasize_of_filelist(parray*filelist);
12231223

1224+
externboolisStreamProccessed(char*seg_filename);/* Checks, that this file is stream processing. File name without path. */
12241225

12251226
/*
12261227
* Slices and arrays for C strings

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp