- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite997a0c
committed
Remove all use of ThisTimeLineID global variable outside of xlog.c
All such code deals with this global variable in one of three ways.Sometimes the same functions use it in more than one of these waysat the same time.First, sometimes it's an implicit argument to one or more functionsbeing called in xlog.c or elsewhere, and must be set to theappropriate value before calling those functions lest theymisbehave. In those cases, it is now passed as an explicit argumentinstead.Second, sometimes it's used to obtain the current timeline afterthe end of recovery, i.e. the timeline to which WAL is beingwritten and flushed. Such code now calls GetWALInsertionTimeLine()or relies on the new out parameter added to GetFlushRecPtr().Third, sometimes it's used during recovery to store the currentreplay timeline. That can change, so such code must generallyupdate the value before each use. It can still do that, but mustnow use a local variable instead.The net effect of these changes is to reduce by a fair amount theamount of code that is directly accessing this global variable.That's good, because history has shown that we don't always thinkclearly about which timeline ID it's supposed to contain at anygiven point in time, or indeed, whether it has been or needs tobe initialized at any given point in the code.Patch by me, reviewed and tested by Michael Paquier, Amul Sul, andÁlvaro Herrera.Discussion:https://postgr.es/m/CA+TgmobfAAqhfWa1kaFBBFvX+5CjM=7TE=n4r4Q1o2bjbGYBpA@mail.gmail.com1 parentcaf1f67 commite997a0c
File tree
13 files changed
+169
-132
lines changed- src
- backend
- access/transam
- replication
- logical
- include/access
13 files changed
+169
-132
lines changedLines changed: 1 addition & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1373 | 1373 |
| |
1374 | 1374 |
| |
1375 | 1375 |
| |
1376 |
| - | |
1377 |
| - | |
1378 |
| - | |
1379 |
| - | |
1380 |
| - | |
| 1376 | + | |
1381 | 1377 |
| |
1382 | 1378 |
| |
1383 | 1379 |
| |
1384 | 1380 |
| |
1385 | 1381 |
| |
1386 | 1382 |
| |
1387 | 1383 |
| |
1388 |
| - | |
1389 | 1384 |
| |
1390 | 1385 |
| |
1391 | 1386 |
| |
| |||
1401 | 1396 |
| |
1402 | 1397 |
| |
1403 | 1398 |
| |
1404 |
| - | |
1405 |
| - | |
1406 |
| - | |
1407 |
| - | |
1408 |
| - | |
1409 |
| - | |
1410 |
| - | |
1411 | 1399 |
| |
1412 | 1400 |
| |
1413 | 1401 |
| |
|
Lines changed: 55 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
192 | 192 |
| |
193 | 193 |
| |
194 | 194 |
| |
195 |
| - | |
| 195 | + | |
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
| |||
917 | 917 |
| |
918 | 918 |
| |
919 | 919 |
| |
920 |
| - | |
| 920 | + | |
| 921 | + | |
921 | 922 |
| |
922 | 923 |
| |
923 | 924 |
| |
| |||
2518 | 2519 |
| |
2519 | 2520 |
| |
2520 | 2521 |
| |
2521 |
| - | |
| 2522 | + | |
2522 | 2523 |
| |
2523 | 2524 |
| |
2524 | 2525 |
| |
| |||
2633 | 2634 |
| |
2634 | 2635 |
| |
2635 | 2636 |
| |
2636 |
| - | |
| 2637 | + | |
2637 | 2638 |
| |
2638 | 2639 |
| |
2639 | 2640 |
| |
2640 | 2641 |
| |
2641 | 2642 |
| |
2642 | 2643 |
| |
2643 | 2644 |
| |
2644 |
| - | |
| 2645 | + | |
2645 | 2646 |
| |
2646 | 2647 |
| |
2647 | 2648 |
| |
| |||
2704 | 2705 |
| |
2705 | 2706 |
| |
2706 | 2707 |
| |
2707 |
| - | |
| 2708 | + | |
2708 | 2709 |
| |
2709 | 2710 |
| |
2710 | 2711 |
| |
| |||
3296 | 3297 |
| |
3297 | 3298 |
| |
3298 | 3299 |
| |
3299 |
| - | |
| 3300 | + | |
| 3301 | + | |
3300 | 3302 |
| |
3301 | 3303 |
| |
3302 | 3304 |
| |
| |||
3305 | 3307 |
| |
3306 | 3308 |
| |
3307 | 3309 |
| |
3308 |
| - | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
3309 | 3313 |
| |
3310 | 3314 |
| |
3311 | 3315 |
| |
| |||
3449 | 3453 |
| |
3450 | 3454 |
| |
3451 | 3455 |
| |
3452 |
| - | |
| 3456 | + | |
| 3457 | + | |
3453 | 3458 |
| |
3454 | 3459 |
| |
3455 | 3460 |
| |
| |||
3481 | 3486 |
| |
3482 | 3487 |
| |
3483 | 3488 |
| |
3484 |
| - | |
| 3489 | + | |
3485 | 3490 |
| |
3486 | 3491 |
| |
3487 | 3492 |
| |
3488 | 3493 |
| |
3489 | 3494 |
| |
3490 |
| - | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
3491 | 3498 |
| |
3492 | 3499 |
| |
3493 | 3500 |
| |
| |||
3629 | 3636 |
| |
3630 | 3637 |
| |
3631 | 3638 |
| |
3632 |
| - | |
| 3639 | + | |
3633 | 3640 |
| |
3634 | 3641 |
| |
3635 | 3642 |
| |
| |||
3653 | 3660 |
| |
3654 | 3661 |
| |
3655 | 3662 |
| |
| 3663 | + | |
| 3664 | + | |
3656 | 3665 |
| |
3657 | 3666 |
| |
3658 | 3667 |
| |
3659 | 3668 |
| |
3660 | 3669 |
| |
3661 | 3670 |
| |
3662 |
| - | |
| 3671 | + | |
3663 | 3672 |
| |
3664 | 3673 |
| |
3665 | 3674 |
| |
3666 | 3675 |
| |
3667 |
| - | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
3668 | 3679 |
| |
3669 | 3680 |
| |
3670 | 3681 |
| |
| |||
3690 | 3701 |
| |
3691 | 3702 |
| |
3692 | 3703 |
| |
3693 |
| - | |
| 3704 | + | |
3694 | 3705 |
| |
3695 | 3706 |
| |
3696 | 3707 |
| |
| |||
3987 | 3998 |
| |
3988 | 3999 |
| |
3989 | 4000 |
| |
3990 |
| - | |
| 4001 | + | |
3991 | 4002 |
| |
3992 | 4003 |
| |
3993 | 4004 |
| |
| |||
4266 | 4277 |
| |
4267 | 4278 |
| |
4268 | 4279 |
| |
4269 |
| - | |
| 4280 | + | |
4270 | 4281 |
| |
4271 | 4282 |
| |
4272 | 4283 |
| |
| |||
5401 | 5412 |
| |
5402 | 5413 |
| |
5403 | 5414 |
| |
5404 |
| - | |
| 5415 | + | |
5405 | 5416 |
| |
5406 | 5417 |
| |
5407 | 5418 |
| |
| |||
5709 | 5720 |
| |
5710 | 5721 |
| |
5711 | 5722 |
| |
5712 |
| - | |
| 5723 | + | |
5713 | 5724 |
| |
5714 | 5725 |
| |
5715 | 5726 |
| |
| |||
8706 | 8717 |
| |
8707 | 8718 |
| |
8708 | 8719 |
| |
8709 |
| - | |
| 8720 | + | |
8710 | 8721 |
| |
8711 | 8722 |
| |
8712 | 8723 |
| |
8713 | 8724 |
| |
8714 | 8725 |
| |
| 8726 | + | |
| 8727 | + | |
| 8728 | + | |
| 8729 | + | |
| 8730 | + | |
| 8731 | + | |
| 8732 | + | |
8715 | 8733 |
| |
8716 | 8734 |
| |
8717 | 8735 |
| |
| 8736 | + | |
| 8737 | + | |
| 8738 | + | |
| 8739 | + | |
| 8740 | + | |
| 8741 | + | |
| 8742 | + | |
| 8743 | + | |
| 8744 | + | |
| 8745 | + | |
| 8746 | + | |
| 8747 | + | |
| 8748 | + | |
8718 | 8749 |
| |
8719 | 8750 |
| |
8720 | 8751 |
| |
| |||
10849 | 10880 |
| |
10850 | 10881 |
| |
10851 | 10882 |
| |
10852 |
| - | |
| 10883 | + | |
10853 | 10884 |
| |
10854 | 10885 |
| |
10855 | 10886 |
| |
10856 | 10887 |
| |
| 10888 | + | |
| 10889 | + | |
10857 | 10890 |
| |
10858 | 10891 |
| |
10859 | 10892 |
| |
| |||
10902 | 10935 |
| |
10903 | 10936 |
| |
10904 | 10937 |
| |
10905 |
| - | |
10906 |
| - | |
| 10938 | + | |
10907 | 10939 |
| |
10908 | 10940 |
| |
10909 | 10941 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
498 | 498 |
| |
499 | 499 |
| |
500 | 500 |
| |
501 |
| - | |
| 501 | + | |
502 | 502 |
| |
503 | 503 |
| |
504 | 504 |
| |
505 |
| - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
506 | 508 |
| |
507 | 509 |
| |
508 | 510 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
382 | 382 |
| |
383 | 383 |
| |
384 | 384 |
| |
385 |
| - | |
| 385 | + | |
386 | 386 |
| |
387 | 387 |
| |
388 | 388 |
| |
| |||
469 | 469 |
| |
470 | 470 |
| |
471 | 471 |
| |
472 |
| - | |
| 472 | + | |
| 473 | + | |
473 | 474 |
| |
474 | 475 |
| |
475 | 476 |
| |
| |||
511 | 512 |
| |
512 | 513 |
| |
513 | 514 |
| |
514 |
| - | |
| 515 | + | |
| 516 | + | |
515 | 517 |
| |
516 | 518 |
| |
517 | 519 |
| |
|
0 commit comments
Comments
(0)