pgstat: prevent fix pgstat_reinit_entry() from zeroing out lwlock.

Zeroing out an lwlock in a normal build turns out to not trigger any alarms,
if nobody can use the lwlock at that moment (as the case here). But with
--disable-spinlocks --disable-atomics, the sema field needs to be initialized.

We probably should make sure that this fails on more common configurations as
well...

Per buildfarm animal rorqual
This commit is contained in:
Andres Freund 2022-04-06 23:35:56 -07:00
parent 3536b851ad
commit 81ae9e6588
1 changed files with 2 additions and 2 deletions

View File

@ -292,8 +292,8 @@ pgstat_reinit_entry(PgStat_Kind kind, PgStatShared_HashEntry *shhashent)
/* reinitialize content */
Assert(shheader->magic == 0xdeadbeef);
memset(shheader, 0, pgstat_get_kind_info(shhashent->key.kind)->shared_size);
shheader->magic = 0xdeadbeef;
memset(pgstat_get_entry_data(kind, shheader), 0,
pgstat_get_entry_len(kind));
return shheader;
}