- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5184932
committed
Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions.
The purpose of commit8a54e12 was tofix this, and it sufficed when the PREPARE TRANSACTION completed beforethe CIC looked for lock conflicts. Otherwise, things still broke. Asbefore, in a cluster having used CIC while having enabled preparedtransactions, queries that use the resulting index can silently fail tofind rows. It may be necessary to reindex to recover from pastoccurrences; REINDEX CONCURRENTLY suffices. Fix this for future indexbuilds by making CIC wait for arbitrarily-recent prepared transactionsand for ordinary transactions that may yet PREPARE TRANSACTION. As partof that, have PREPARE TRANSACTION transfer locks to its dummy PGPROCbefore it calls ProcArrayClearTransaction(). Back-patch to 9.6 (allsupported versions).Andrey Borodin, reviewed (in earlier versions) by Andres Freund.Discussion:https://postgr.es/m/01824242-AA92-4FE9-9BA7-AEBAFFEA3D0C@yandex-team.ru1 parente428699 commit5184932
File tree
9 files changed
+466
-36
lines changed- src
- backend
- access/transam
- storage/lmgr
- utils/cache
- bin/pgbench/t
- include
- access
- storage
- test/perl
9 files changed
+466
-36
lines changedLines changed: 57 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
410 | 410 |
| |
411 | 411 |
| |
412 | 412 |
| |
413 |
| - | |
414 |
| - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
415 | 426 |
| |
416 | 427 |
| |
417 | 428 |
| |
418 | 429 |
| |
419 | 430 |
| |
420 |
| - | |
421 | 431 |
| |
422 | 432 |
| |
423 | 433 |
| |
| |||
801 | 811 |
| |
802 | 812 |
| |
803 | 813 |
| |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
804 | 858 |
| |
805 | 859 |
| |
806 | 860 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2368 | 2368 |
| |
2369 | 2369 |
| |
2370 | 2370 |
| |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
2371 | 2378 |
| |
2372 | 2379 |
| |
2373 | 2380 |
| |
| |||
2407 | 2414 |
| |
2408 | 2415 |
| |
2409 | 2416 |
| |
2410 |
| - | |
2411 | 2417 |
| |
2412 | 2418 |
| |
2413 | 2419 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
822 | 822 |
| |
823 | 823 |
| |
824 | 824 |
| |
825 |
| - | |
826 |
| - | |
827 |
| - | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
828 | 829 |
| |
829 | 830 |
| |
830 | 831 |
| |
|
Lines changed: 81 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2787 | 2787 |
| |
2788 | 2788 |
| |
2789 | 2789 |
| |
2790 |
| - | |
2791 |
| - | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
2792 | 2796 |
| |
2793 | 2797 |
| |
2794 | 2798 |
| |
| |||
4405 | 4409 |
| |
4406 | 4410 |
| |
4407 | 4411 |
| |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
| 4423 | + | |
| 4424 | + | |
| 4425 | + | |
| 4426 | + | |
| 4427 | + | |
| 4428 | + | |
| 4429 | + | |
| 4430 | + | |
| 4431 | + | |
| 4432 | + | |
| 4433 | + | |
| 4434 | + | |
| 4435 | + | |
| 4436 | + | |
| 4437 | + | |
| 4438 | + | |
| 4439 | + | |
| 4440 | + | |
| 4441 | + | |
| 4442 | + | |
| 4443 | + | |
| 4444 | + | |
| 4445 | + | |
| 4446 | + | |
| 4447 | + | |
| 4448 | + | |
| 4449 | + | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
| 4461 | + | |
| 4462 | + | |
| 4463 | + | |
| 4464 | + | |
4408 | 4465 |
| |
4409 | 4466 |
| |
4410 | 4467 |
| |
4411 |
| - | |
4412 |
| - | |
| 4468 | + | |
| 4469 | + | |
4413 | 4470 |
| |
4414 |
| - | |
4415 |
| - | |
| 4471 | + | |
| 4472 | + | |
4416 | 4473 |
| |
4417 | 4474 |
| |
4418 | 4475 |
| |
4419 | 4476 |
| |
4420 | 4477 |
| |
4421 | 4478 |
| |
| 4479 | + | |
4422 | 4480 |
| |
4423 | 4481 |
| |
4424 | 4482 |
| |
4425 |
| - | |
4426 |
| - | |
4427 |
| - | |
4428 |
| - | |
4429 |
| - | |
4430 |
| - | |
4431 |
| - | |
4432 |
| - | |
4433 |
| - | |
4434 |
| - | |
4435 |
| - | |
4436 |
| - | |
4437 |
| - | |
4438 |
| - | |
| 4483 | + | |
| 4484 | + | |
| 4485 | + | |
4439 | 4486 |
| |
4440 | 4487 |
| |
4441 | 4488 |
| |
| |||
4449 | 4496 |
| |
4450 | 4497 |
| |
4451 | 4498 |
| |
4452 |
| - | |
| 4499 | + | |
4453 | 4500 |
| |
4454 | 4501 |
| |
4455 | 4502 |
| |
| |||
4458 | 4505 |
| |
4459 | 4506 |
| |
4460 | 4507 |
| |
4461 |
| - | |
4462 | 4508 |
| |
4463 | 4509 |
| |
4464 | 4510 |
| |
| 4511 | + | |
4465 | 4512 |
| |
4466 |
| - | |
| 4513 | + | |
4467 | 4514 |
| |
4468 | 4515 |
| |
4469 | 4516 |
| |
| |||
4510 | 4557 |
| |
4511 | 4558 |
| |
4512 | 4559 |
| |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
4513 | 4570 |
| |
4514 | 4571 |
| |
4515 | 4572 |
| |
4516 | 4573 |
| |
4517 | 4574 |
| |
4518 | 4575 |
| |
4519 | 4576 |
| |
4520 |
| - | |
| 4577 | + | |
4521 | 4578 |
| |
4522 | 4579 |
| |
4523 | 4580 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
67 | 81 |
| |
68 | 82 |
| |
69 | 83 |
| |
|
0 commit comments
Comments
(0)