Re: [HACKERS] Autovacuum launcher occurs error when cancelled bySIGINT - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Autovacuum launcher occurs error when cancelled bySIGINT
Date
Msg-id 20170622175254.7t3htsf3boaaltoa@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Thomas Munro wrote:

> Hmm.  So the problem here is that AutoVacLauncherMain assumes that
> there are only two possibilities: (1) there is no handle published in
> shmem yet, so we should create a DSA area and publish the handle, and
> (2) there is a handle published in shmem so we should attach to it.
> But there is a another possiblity: (3) there is a handle published in
> shmem, but we are already attached to it (because we've restarted our
> main loop after SIGINT).
> 
> The suggestion so far was to check if we're already attached to that
> segment (making use of the implementation detail that a DSA handle is
> also a DSM segment handle), but don't we know if we're already
> attached by checking our AutoVacuumDSA variable?

This seems like a good fix to me.  Pushed this way, with an additional
comment.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] possible self-deadlock window after badProcessStartupPacket
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Missing comment for create_modifytable_path