forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4f88dba
committed
Fix lock assertions in dshash.c.
dshash.c previously maintained flags to be able to assert that youdidn't hold any partition lock. These flags could get out of sync withreality in error scenarios.Get rid of all that, and make assertions about the locks themselvesinstead. Since LWLockHeldByMe() loops internally, we don't want to putthat inside another loop over all partition locks. Introduce a newdebugging-only interface LWLockAnyHeldByMe() to avoid that.This problem was noted by Tom and Andres while reviewing changes tosupport the new shared memory stats system, and later showed up inreality while working on commit389869a.Back-patch to 11, where dshash.c arrived.Reported-by: Tom Lane <tgl@sss.pgh.pa.us>Reported-by: Andres Freund <andres@anarazel.de>Reviewed-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>Reviewed-by: Zhihong Yu <zyu@yugabyte.com>Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20220311012712.botrpsikaufzteyt@alap3.anarazel.deDiscussion:https://postgr.es/m/CA%2BhUKGJ31Wce6HJ7xnVTKWjFUWQZPBngxfJVx4q0E98pDr3kAw%40mail.gmail.com1 parent09224a3 commit4f88dba
3 files changed
+37
-27
lines changedLines changed: 10 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
110 | 110 |
| |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
114 |
| - | |
115 | 113 |
| |
116 | 114 |
| |
117 | 115 |
| |
| |||
186 | 184 |
| |
187 | 185 |
| |
188 | 186 |
| |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
189 | 191 |
| |
190 | 192 |
| |
191 | 193 |
| |
| |||
226 | 228 |
| |
227 | 229 |
| |
228 | 230 |
| |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 | 231 |
| |
233 | 232 |
| |
234 | 233 |
| |
| |||
277 | 276 |
| |
278 | 277 |
| |
279 | 278 |
| |
280 |
| - | |
281 |
| - | |
282 | 279 |
| |
283 | 280 |
| |
284 | 281 |
| |
| |||
301 | 298 |
| |
302 | 299 |
| |
303 | 300 |
| |
304 |
| - | |
| 301 | + | |
305 | 302 |
| |
306 | 303 |
| |
307 | 304 |
| |
| |||
392 | 389 |
| |
393 | 390 |
| |
394 | 391 |
| |
395 |
| - | |
| 392 | + | |
396 | 393 |
| |
397 | 394 |
| |
398 | 395 |
| |
| |||
409 | 406 |
| |
410 | 407 |
| |
411 | 408 |
| |
412 |
| - | |
413 |
| - | |
414 |
| - | |
| 409 | + | |
415 | 410 |
| |
416 | 411 |
| |
417 | 412 |
| |
| |||
441 | 436 |
| |
442 | 437 |
| |
443 | 438 |
| |
444 |
| - | |
| 439 | + | |
445 | 440 |
| |
446 | 441 |
| |
447 | 442 |
| |
| |||
486 | 481 |
| |
487 | 482 |
| |
488 | 483 |
| |
489 |
| - | |
490 |
| - | |
491 | 484 |
| |
492 | 485 |
| |
493 | 486 |
| |
| |||
506 | 499 |
| |
507 | 500 |
| |
508 | 501 |
| |
509 |
| - | |
| 502 | + | |
510 | 503 |
| |
511 | 504 |
| |
512 | 505 |
| |
| |||
543 | 536 |
| |
544 | 537 |
| |
545 | 538 |
| |
546 |
| - | |
547 |
| - | |
548 | 539 |
| |
549 | 540 |
| |
550 | 541 |
| |
551 | 542 |
| |
552 |
| - | |
553 |
| - | |
554 | 543 |
| |
555 | 544 |
| |
556 | 545 |
| |
| |||
564 | 553 |
| |
565 | 554 |
| |
566 | 555 |
| |
567 |
| - | |
568 |
| - | |
569 |
| - | |
570 |
| - | |
571 | 556 |
| |
572 |
| - | |
573 |
| - | |
574 | 557 |
| |
575 | 558 |
| |
576 | 559 |
| |
| |||
603 | 586 |
| |
604 | 587 |
| |
605 | 588 |
| |
606 |
| - | |
| 589 | + | |
607 | 590 |
| |
608 | 591 |
| |
609 | 592 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1843 | 1843 |
| |
1844 | 1844 |
| |
1845 | 1845 |
| |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1846 | 1872 |
| |
1847 | 1873 |
| |
1848 | 1874 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
150 | 150 |
| |
151 | 151 |
| |
152 | 152 |
| |
| 153 | + | |
153 | 154 |
| |
154 | 155 |
| |
155 | 156 |
| |
|
0 commit comments
Comments
(0)