forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7cdd0c2
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 parente5b5b44 commit7cdd0c2
3 files changed
+36
-26
lines changedLines changed: 9 additions & 26 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 |
| |
| |||
410 | 407 |
| |
411 | 408 |
| |
412 | 409 |
| |
413 |
| - | |
414 |
| - | |
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 | |
---|---|---|---|
| |||
1941 | 1941 |
| |
1942 | 1942 |
| |
1943 | 1943 |
| |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
1944 | 1970 |
| |
1945 | 1971 |
| |
1946 | 1972 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
152 | 153 |
| |
153 | 154 |
| |
154 | 155 |
| |
|
0 commit comments
Comments
(0)