forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3f1ce97
committed
Add circular WAL decoding buffer, take II.
Teach xlogreader.c to decode the WAL into a circular buffer. This willsupport optimizations based on looking ahead, to follow in a latercommit. * XLogReadRecord() works as before, decoding records one by one, and allowing them to be examined via the traditional XLogRecGetXXX() macros and certain traditional members like xlogreader->ReadRecPtr. * An alternative new interface XLogReadAhead()/XLogNextRecord() is added that returns pointers to DecodedXLogRecord objects so that it's now possible to look ahead in the WAL stream while replaying. * In order to be able to use the new interface effectively while streaming data, support is added for the page_read() callback to respond to a new nonblocking mode with XLREAD_WOULDBLOCK instead of waiting for more data to arrive.No direct user of the new interface is included in this commit, thoughXLogReadRecord() uses it internally. Existing code doesn't need tochange, except in a few places where it was accessing reader internalsdirectly and now needs to go through accessor macros.Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>Reviewed-by: Andres Freund <andres@anarazel.de> (earlier versions)Discussion:https://postgr.es/m/CA+hUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq=AovOddfHpA@mail.gmail.com1 parent7a7cd84 commit3f1ce97
File tree
10 files changed
+686
-174
lines changed- src
- backend
- access/transam
- replication/logical
- bin
- pg_rewind
- pg_waldump
- include/access
- tools/pgindent
10 files changed
+686
-174
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
482 | 482 |
| |
483 | 483 |
| |
484 | 484 |
| |
485 |
| - | |
| 485 | + | |
486 | 486 |
| |
487 | 487 |
| |
488 |
| - | |
| 488 | + | |
489 | 489 |
| |
490 | 490 |
| |
491 | 491 |
| |
| |||
525 | 525 |
| |
526 | 526 |
| |
527 | 527 |
| |
528 |
| - | |
| 528 | + | |
529 | 529 |
| |
530 | 530 |
| |
531 | 531 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
971 | 971 |
| |
972 | 972 |
| |
973 | 973 |
| |
| 974 | + | |
| 975 | + | |
974 | 976 |
| |
975 | 977 |
| |
976 | 978 |
| |
| |||
990 | 992 |
| |
991 | 993 |
| |
992 | 994 |
| |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
993 | 1000 |
| |
994 | 1001 |
| |
995 | 1002 |
| |
| |||
998 | 1005 |
| |
999 | 1006 |
| |
1000 | 1007 |
| |
1001 |
| - | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
1002 | 1012 |
| |
1003 | 1013 |
| |
1004 | 1014 |
| |
| |||
1007 | 1017 |
| |
1008 | 1018 |
| |
1009 | 1019 |
| |
| 1020 | + | |
| 1021 | + | |
1010 | 1022 |
| |
| 1023 | + | |
1011 | 1024 |
| |
1012 | 1025 |
| |
1013 | 1026 |
| |
| 1027 | + | |
1014 | 1028 |
| |
1015 | 1029 |
| |
1016 | 1030 |
| |
| |||
7738 | 7752 |
| |
7739 | 7753 |
| |
7740 | 7754 |
| |
7741 |
| - | |
| 7755 | + | |
7742 | 7756 |
| |
7743 | 7757 |
| |
7744 | 7758 |
| |
|
0 commit comments
Comments
(0)