- Notifications
You must be signed in to change notification settings - Fork5k
Commit047cba7
committed
bufmgr: Implement AIO read support
This commit implements the infrastructure to perform asynchronous reads intothe buffer pool.To do so, it:- Adds readv AIO callbacks for shared and local buffers It may be worth calling out that shared buffer completions may be run in a different backend than where the IO started.- Adds an AIO wait reference to BufferDesc, to allow backends to wait for in-progress asynchronous IOs- Adapts StartBufferIO(), WaitIO(), TerminateBufferIO(), and their localbuf.c equivalents, to be able to deal with AIO- Moves the code to handle BM_PIN_COUNT_WAITER into a helper function, as it now also needs to be called on IO completionAs of this commit, nothing issues AIO on shared/local buffers. A future commitwill update StartReadBuffers() to do so.Buffer reads executed through this infrastructure will report invalid page /checksum errors / warnings differently than before:In the error case the error message will cover all the blocks that wereincluded in the read, rather than just the reporting the first invalidblock. If more than one block is invalid, the error will include informationabout the range of the read, the first invalid block and the number of invalidpages, with a HINT towards the server log for per-block details.For the warning case (i.e. zero_damaged_buffers) we would previously emit onewarning message for each buffer in a multi-block read. Now there is only asingle warning message for the entire read, again referring to the server logfor more details in case of multiple checksum failures within a single largerread.Reviewed-by: Noah Misch <noah@leadboat.com>Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>Discussion:https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadptsjvjqcluzmah%40brqs62irg4dtDiscussion:https://postgr.es/m/20210223100344.llw5an2aklengrmn@alap3.anarazel.deDiscussion:https://postgr.es/m/stj36ea6yyhoxtqkhpieia2z4krnam7qyetc57rfezgk4zgapf@gcnactj4z56m1 parentef64fe2 commit047cba7
File tree
10 files changed
+885
-66
lines changed- src
- backend/storage
- aio
- buffer
- page
- include/storage
10 files changed
+885
-66
lines changedLines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 |
| |
44 | 49 |
| |
45 | 50 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
150 |
| - | |
151 |
| - | |
152 |
| - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 |
| |
154 | 157 |
| |
155 | 158 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
| |||
125 | 126 |
| |
126 | 127 |
| |
127 | 128 |
| |
| 129 | + | |
| 130 | + | |
128 | 131 |
| |
129 | 132 |
| |
130 | 133 |
| |
|
0 commit comments
Comments
(0)