forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3ccc66d
committed
Fix bug in LWLock statistics mechanism.
Previously PostgreSQL built with -DLWLOCK_STATS could reportmore than one LWLock statistics entries for the same backendprocess and the same LWLock. This is strange and only onestatistics should be output in that case, instead.The cause of this issue is that the key variable used forLWLock stats hash table was not fully initialized. The keyconsists of two fields and they were initialized. Butthe following 4 bytes allocated in the key variable forthe alignment was not initialized. So even if the same keywas specified, hash_search(HASH_ENTER) could not findthe existing entry for that key and created new one.This commit fixes this issue by initializing the keyvariable with zero. As the side effect of this commit,the volume of LWLock statistics output would be reducedvery much.Back-patch to v10, where commit3761fe3 introduced the issue.Author: Fujii MasaoReviewed-by: Julien Rouhaud, Kyotaro HoriguchiDiscussion:https://postgr.es/m/26359edb-798a-568f-d93a-6aafac49752d@oss.nttdata.com1 parentb025f32 commit3ccc66d
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
| 313 | + | |
313 | 314 |
| |
314 | 315 |
| |
315 | 316 |
| |
|
0 commit comments
Comments
(0)