Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvSK3-0004UI-08 for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Feb 2019 19:41:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvSK1-0004UH-E3 for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Feb 2019 19:41:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvSK1-0004UA-1q for pgsql-hackers@lists.postgresql.org; Sun, 17 Feb 2019 19:41:53 +0000 Received: from mail-it1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvSJy-0002Qx-5p for pgsql-hackers@postgresql.org; Sun, 17 Feb 2019 19:41:52 +0000 Received: by mail-it1-x131.google.com with SMTP id x131so35250028itc.3 for ; Sun, 17 Feb 2019 11:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ssCW8B0V4/ff0+SPLc1duVZEZIU5eOpuTjfiOY8IfqA=; b=mN+4C7a/+uxZKZ7U0mXqLKmtvg3KmIa+LVvVDnvjSrYg6WdqfeSZON7zTz2QyP2saS D1iXuuEuzP+oo+FONOp9T3674EHERuXZfufZkuCx15hnoxPPyIUerlP0P9fW9r2KtYFI iQFzj2YYLpOePFtKaGwY1PCmuIEtU7HmP8utwBLPf3XoXI9FCeMSrXyGIesbfmEmSsdS qndhVHFHR9UW+YwAeVgncLKhqLE8w6jA3h3EsJCedeltQoK/JYWd0F0lL8bmH+tkYUo1 uuMLCl3z/7F+8y0czNyuHxlorsG6n16hRiApgSHiYXw+Vcofno6JrbrFafTbafJmF7TM NyRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ssCW8B0V4/ff0+SPLc1duVZEZIU5eOpuTjfiOY8IfqA=; b=H4hbB6419THEYOD7wQc8BgW6433VfQkanyP0NBkmnJlHj6XQlYox/JZwIiHStcCLfz MEroPxWd9OPWPna1dlSNjCxUeLxWbjVKzQzzCdb6/qeaCO+ZtR21v7ecoWaDYj/QOUqN 5TF/ZYXwTKVK7dTkKgEImHWAbvx+/Mu4eRRha2F9Foy3ycd/lsCPPi2zC/UestXqCotz 12GmXYZAruGMYhj1tOvT7AiJ/kovi0GvWz0pPCa9wVpNtuluVr2vk1DLKmx6lhhKq1y5 n9WhLK8/rBURp5MVch1wx5bbu9psg32wItlKv4+2Jm+LQLTSddbJbIyUDWrILTLS/b1M xh2A== X-Gm-Message-State: AHQUAubHEpHdjk0lfw11TgLRbWefSucvuuSRJkqOy7N2L47d8Lsus1ja zIhb/g22kGMx548X5e2daCVzew== X-Google-Smtp-Source: AHgI3Ibe1u/G6kqsra5981XgYFFEEvrTetTUH/hRFYhCvFxSnE9lcaS2lYcfLt3EyKdvxBg7jVFMeg== X-Received: by 2002:a24:8a44:: with SMTP id v65mr9825750itd.67.1550432507772; Sun, 17 Feb 2019 11:41:47 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id q64sm5120714iod.48.2019.02.17.11.41.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Feb 2019 11:41:46 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 556F6800B9A; Sun, 17 Feb 2019 13:41:45 -0600 (CST) Date: Sun, 17 Feb 2019 13:41:45 -0600 From: Justin Pryzby To: Thomas Munro Cc: pgsql-hackers@postgresql.org Subject: Re: REL_11_STABLE: dsm.c - cannot unpin a segment that is not pinned Message-ID: <20190217194145.GA28750@telsasoft.com> References: <20190216023854.GF30291@telsasoft.com> <20190216043107.GG30291@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Feb 16, 2019 at 09:16:01PM +1300, Thomas Munro wrote: > On Sat, Feb 16, 2019 at 5:31 PM Justin Pryzby wrote: > > Thanks, will leave it spinning overnight. No errors in ~36 hours (126 CPU-hrs), so that seems to work. Thanks. > > Do you know if any of the others should also be changed ? > > Good question, let me double check... > > > $ grep 'refcnt == 0' src/backend/storage/ipc/dsm.c > > if (refcnt == 0) > > That's dsm_cleanup_using_control_segment() and runs when starting up > before any workers can be running to clean up after a preceding crash, > so it's OK (if it's 1, meaning we crashed while that slot was going > away, we'll try to destroy it again, which is correct). Good. > > > if (dsm_control->item[i].refcnt == 0) > > That's dsm_postmaster_shutdown(), similar but at shutdown time, run by > the postmaster, and it errs on the side of trying to destroy. Good. > > > if (dsm_control->item[i].refcnt == 0) > > That's dsm_create(), and it's looking specifically for a free slot, > and that's 0 only, it'll step over used/active (refcnt > 1) and > used/going-away (refcnt == 1). Good.