forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9a30e15
committed
Use macros from xlog_internal.h for WAL segment logic in pg_resetwal
When scanning for the end of WAL, pg_resetwal has been maintaining itsown internal logic to calculate segment numbers and to parse a WALsegment name for its timeline and segment number. The code claimed forexample that XLogFromFileName() cannot be used because it lacks thepossibility of specifying a WAL segment size, which is not the casesincefc49e24, that has made the WAL segment size configurable atinitialization time, extending this routine to do so.Similarly, this switches one segment number calculation to useXLByteToSeg() rather than the same logic present in xlog_internal.h.While on it, switch to TimeLineID in pg_resetwal.c for TLI numbersparsed from segment names, to be more consistent withXLogFromFileName(). The maths are exactly the same, but the code getssimplified.Author: Bharath RupireddyReviewed-by: Kyotaro HoriguchiDiscussion:https://postgr.es/m/CALj2ACX+E_jnwqH_jmjhNG8BczJTNRTOLpw8K1CB1OcB48MJ8w@mail.gmail.com1 parent9aa58d4 commit9a30e15
1 file changed
+7
-14
lines changedLines changed: 7 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
| |||
901 | 901 |
| |
902 | 902 |
| |
903 | 903 |
| |
904 |
| - | |
905 | 904 |
| |
906 | 905 |
| |
907 | 906 |
| |
908 | 907 |
| |
909 | 908 |
| |
910 | 909 |
| |
911 | 910 |
| |
912 |
| - | |
913 |
| - | |
| 911 | + | |
| 912 | + | |
914 | 913 |
| |
915 | 914 |
| |
916 | 915 |
| |
| |||
926 | 925 |
| |
927 | 926 |
| |
928 | 927 |
| |
929 |
| - | |
930 |
| - | |
931 |
| - | |
| 928 | + | |
932 | 929 |
| |
933 | 930 |
| |
934 |
| - | |
935 |
| - | |
936 |
| - | |
937 |
| - | |
938 |
| - | |
939 |
| - | |
940 |
| - | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
941 | 934 |
| |
942 | 935 |
| |
943 | 936 |
| |
|
0 commit comments
Comments
(0)