Re: SLRU statistics - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SLRU statistics
Date
Msg-id 2668.1589384295@sss.pgh.pa.us
Whole thread Raw
In response to Re: SLRU statistics  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: SLRU statistics
List pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> I think it counts as a variable with "static storage duration" per 6.7.8
> (para 10), see [1]. I wasn't aware of this either, but it probably means
> the memset is unnecessary.
> Also, it seems a bit strange/confusing to handle this differently from
> BgWriterStats. And that worked fine without the init for years ...

Yeah, exactly.

There might be merit in memsetting it if we thought that it could have
become nonzero in the postmaster during a previous shmem cycle-of-life.
But the postmaster really shouldn't be accumulating such counts; and
if it is, then we have a bigger problem, because child processes would
be inheriting those counts via fork.

I think this change is unnecessary and should be reverted to avoid
future confusion about whether somehow it is necessary.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add "-Wimplicit-fallthrough" to default flags
Next
From: Dilip Kumar
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions