- Notifications
You must be signed in to change notification settings - Fork5
Commitfe7337f
committed
Fix off-by-one in decoding causing one-record events to be skipped.
A ReorderBufferTransaction's end_lsn, the sentPtr advocated bywalsender keepalive messages, and the end location remembered by thedecoding get_*changes* SQL functions all use the location of the lastread record + 1. I.e. the LSN points to the beginning of the nextrecord. That cannot realistically be changed without changing thereplication protocol because that's how keepalive messages have workedsince 9.0.The bug is that the logic inside the snapshot builder, which decideswhether a transaction's contents should be decoded, assumed the startlocation would point towards the last byte of the last record. Thereason this didn't actually cause visible problems is that currentlythat decision is only made for commit records. Since interestingtransactions always have at least one additional record - containingactual data - we'd never skip a transaction.But if there ever were transactions, or other events, with just onerecord containing important information, we'd skip them after stoppingand restarting logical decoding.1 parent5f93c37 commitfe7337f
1 file changed
+10
-9
lines changedLines changed: 10 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 |
| - | |
| 156 | + | |
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
| 160 | + | |
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
312 |
| - | |
| 312 | + | |
313 | 313 |
| |
314 | 314 |
| |
315 | 315 |
| |
| |||
375 | 375 |
| |
376 | 376 |
| |
377 | 377 |
| |
378 |
| - | |
| 378 | + | |
379 | 379 |
| |
380 | 380 |
| |
381 | 381 |
| |
| |||
955 | 955 |
| |
956 | 956 |
| |
957 | 957 |
| |
958 |
| - | |
959 |
| - | |
| 958 | + | |
| 959 | + | |
960 | 960 |
| |
961 | 961 |
| |
962 | 962 |
| |
| |||
1243 | 1243 |
| |
1244 | 1244 |
| |
1245 | 1245 |
| |
1246 |
| - | |
1247 |
| - | |
1248 |
| - | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1249 | 1250 |
| |
1250 | 1251 |
| |
1251 | 1252 |
| |
|
0 commit comments
Comments
(0)