|
51 | 51 | #include "replication/origin.h" |
52 | 52 | #include "replication/snapbuild.h" |
53 | 53 | #include "replication/syncrep.h" |
| 54 | +#include "storage/aio_subsys.h" |
54 | 55 | #include "storage/condition_variable.h" |
55 | 56 | #include "storage/fd.h" |
56 | 57 | #include "storage/lmgr.h" |
@@ -2411,6 +2412,8 @@ CommitTransaction(void) |
2411 | 2412 | RESOURCE_RELEASE_BEFORE_LOCKS, |
2412 | 2413 | true, true); |
2413 | 2414 |
|
| 2415 | + AtEOXact_Aio(true); |
| 2416 | + |
2414 | 2417 | /* Check we've released all buffer pins */ |
2415 | 2418 | AtEOXact_Buffers(true); |
2416 | 2419 |
|
@@ -2716,6 +2719,8 @@ PrepareTransaction(void) |
2716 | 2719 | RESOURCE_RELEASE_BEFORE_LOCKS, |
2717 | 2720 | true, true); |
2718 | 2721 |
|
| 2722 | + AtEOXact_Aio(true); |
| 2723 | + |
2719 | 2724 | /* Check we've released all buffer pins */ |
2720 | 2725 | AtEOXact_Buffers(true); |
2721 | 2726 |
|
@@ -2830,6 +2835,8 @@ AbortTransaction(void) |
2830 | 2835 | pgstat_report_wait_end(); |
2831 | 2836 | pgstat_progress_end_command(); |
2832 | 2837 |
|
| 2838 | + pgaio_error_cleanup(); |
| 2839 | + |
2833 | 2840 | /* Clean up buffer content locks, too */ |
2834 | 2841 | UnlockBuffers(); |
2835 | 2842 |
|
@@ -2960,6 +2967,7 @@ AbortTransaction(void) |
2960 | 2967 | ResourceOwnerRelease(TopTransactionResourceOwner, |
2961 | 2968 | RESOURCE_RELEASE_BEFORE_LOCKS, |
2962 | 2969 | false, true); |
| 2970 | + AtEOXact_Aio(false); |
2963 | 2971 | AtEOXact_Buffers(false); |
2964 | 2972 | AtEOXact_RelationCache(false); |
2965 | 2973 | AtEOXact_TypeCache(); |
@@ -5232,6 +5240,9 @@ AbortSubTransaction(void) |
5232 | 5240 |
|
5233 | 5241 | pgstat_report_wait_end(); |
5234 | 5242 | pgstat_progress_end_command(); |
| 5243 | + |
| 5244 | + pgaio_error_cleanup(); |
| 5245 | + |
5235 | 5246 | UnlockBuffers(); |
5236 | 5247 |
|
5237 | 5248 | /* Reset WAL record construction state */ |
@@ -5326,6 +5337,7 @@ AbortSubTransaction(void) |
5326 | 5337 | RESOURCE_RELEASE_BEFORE_LOCKS, |
5327 | 5338 | false, false); |
5328 | 5339 |
|
| 5340 | + AtEOXact_Aio(false); |
5329 | 5341 | AtEOSubXact_RelationCache(false, s->subTransactionId, |
5330 | 5342 | s->parent->subTransactionId); |
5331 | 5343 | AtEOSubXact_TypeCache(); |
|
0 commit comments