forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf003d9f
committed
Add circular WAL decoding buffer.
Teach xlogreader.c to decode its output into a circular buffer, tosupport optimizations based on looking ahead. * XLogReadRecord() works as before, consuming records one by one, and allowing them to be examined via the traditional XLogRecGetXXX() macros. * An alternative new interface XLogNextRecord() is added that returns pointers to DecodedXLogRecord structs that can be examined directly. * XLogReadAhead() provides a second cursor that lets you see further ahead, as long as data is available and there is enough space in the decoding buffer. This returns DecodedXLogRecord pointers to the caller, but also adds them to a queue of records that will later be consumed by XLogNextRecord()/XLogReadRecord().The buffer's size is controlled with wal_decode_buffer_size. The buffercould potentially be placed into shared memory, for future projects.Large records that don't fit in the circular buffer are called"oversized" and allocated separately with palloc().Discussion:https://postgr.es/m/CA+hUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq=AovOddfHpA@mail.gmail.com1 parent323cbe7 commitf003d9f
File tree
8 files changed
+734
-200
lines changed- src
- backend
- access/transam
- replication/logical
- bin
- pg_rewind
- pg_waldump
- include/access
8 files changed
+734
-200
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: 23 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1209 | 1209 |
| |
1210 | 1210 |
| |
1211 | 1211 |
| |
| 1212 | + | |
1212 | 1213 |
| |
1213 | 1214 |
| |
1214 | 1215 |
| |
| |||
1224 | 1225 |
| |
1225 | 1226 |
| |
1226 | 1227 |
| |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1227 | 1231 |
| |
1228 | 1232 |
| |
1229 | 1233 |
| |
1230 | 1234 |
| |
1231 | 1235 |
| |
1232 | 1236 |
| |
1233 | 1237 |
| |
1234 |
| - | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1235 | 1241 |
| |
1236 | 1242 |
| |
1237 | 1243 |
| |
| |||
1240 | 1246 |
| |
1241 | 1247 |
| |
1242 | 1248 |
| |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1243 | 1254 |
| |
| 1255 | + | |
1244 | 1256 |
| |
1245 | 1257 |
| |
1246 | 1258 |
| |
| 1259 | + | |
1247 | 1260 |
| |
1248 | 1261 |
| |
1249 | 1262 |
| |
| |||
1417 | 1430 |
| |
1418 | 1431 |
| |
1419 | 1432 |
| |
1420 |
| - | |
| 1433 | + | |
1421 | 1434 |
| |
1422 | 1435 |
| |
1423 | 1436 |
| |
| |||
4383 | 4396 |
| |
4384 | 4397 |
| |
4385 | 4398 |
| |
| 4399 | + | |
4386 | 4400 |
| |
4387 | 4401 |
| |
4388 | 4402 |
| |
| |||
10300 | 10314 |
| |
10301 | 10315 |
| |
10302 | 10316 |
| |
10303 |
| - | |
| 10317 | + | |
10304 | 10318 |
| |
10305 | 10319 |
| |
10306 | 10320 |
| |
| |||
10435 | 10449 |
| |
10436 | 10450 |
| |
10437 | 10451 |
| |
10438 |
| - | |
| 10452 | + | |
10439 | 10453 |
| |
10440 | 10454 |
| |
10441 | 10455 |
| |
| |||
12104 | 12118 |
| |
12105 | 12119 |
| |
12106 | 12120 |
| |
12107 |
| - | |
| 12121 | + | |
12108 | 12122 |
| |
12109 | 12123 |
| |
12110 | 12124 |
| |
| |||
12122 | 12136 |
| |
12123 | 12137 |
| |
12124 | 12138 |
| |
| 12139 | + | |
| 12140 | + | |
| 12141 | + | |
12125 | 12142 |
| |
12126 | 12143 |
| |
12127 | 12144 |
| |
| |||
12613 | 12630 |
| |
12614 | 12631 |
| |
12615 | 12632 |
| |
| 12633 | + | |
12616 | 12634 |
| |
12617 | 12635 |
| |
12618 | 12636 |
| |
|
0 commit comments
Comments
(0)