Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50YE-0004HW-En for pgsql-hackers@arkaria.postgresql.org; Mon, 01 May 2017 01:54:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d50YD-0002px-TP for pgsql-hackers@arkaria.postgresql.org; Mon, 01 May 2017 01:54:57 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d50YC-0002ob-CE for pgsql-hackers@postgresql.org; Mon, 01 May 2017 01:54:56 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d50Y8-0006Ek-Ci for pgsql-hackers@postgresql.org; Mon, 01 May 2017 01:54:55 +0000 Received: by mail-wm0-x22b.google.com with SMTP id u65so80242834wmu.1 for ; Sun, 30 Apr 2017 18:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=gPij5qKQGlKrxRl0seG0MDc4G4kGGXPaQex1gdpjTbk=; b=YQruSeCjMjNRqqmGqzwzIbDnV/khJHbyrzKE3+G3L06BJyuuCyGdO5zlhymGwnqidh sqNMfHgx1i93o5zg9I73ovmlqqV+Z5xq3az59+3KYA72cw04HawohlyyxTFapjVShXDV JGMRFC551VnbBzQjS39Gx1I+/0ha86+CChSTzfESx1KR73j8ep7FxuxLUhYV+SNyuGkA FNN+GH6kOJINgvAkf23Kpp+clnQSLsRlOde1ryZDDxM8IanhztkeFW4vvYfdpelbedS2 sMdpM0sUKVAlz8x9y4TIWH3QoEnNhi/KamCDoHqNkOXHytGezG3pZUcl8zW+g8xnV0mL Es+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=gPij5qKQGlKrxRl0seG0MDc4G4kGGXPaQex1gdpjTbk=; b=AuW0vFVLyKwXnOogXQ/OPg+ZclU4Bs7XSWbp3dyOA85eiDknrY8b0vHGt6wBRMpqAk rW32IjBBbZo5nhbXm0K/KGPCSBD62y2AZN2pyFwjwirLTeKWUni8y6tobymwakUeOV5z Uh3yhfKYLffboMKwJiach1+r9GLc1VDG6SVGfW12RbcrmexrfDgsSEoUbArcxbfAoBCA wU2G5xYCJXfQcVRLLRdTt6q2xiJuVUPhGvVr9dmrcJgwdcOcDgNd+dJV743XIKd9yF2C +S6jKrWA9pYT7ynp2KV0AEf2BJqB67od303Iasej79O3jQ+rgTktaHL5L18pNDm4FhYh 32Jw== X-Gm-Message-State: AN3rC/5kmnCXM4f4pJcaJ/RxV3NCCOx8GOHo9PS82MDAw/jq/6DKZynI LEea/fz3Y+9kVqN6 X-Received: by 10.28.234.144 with SMTP id g16mr5310706wmi.61.1493603690694; Sun, 30 Apr 2017 18:54:50 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id b80sm7136299wma.5.2017.04.30.18.54.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 18:54:49 -0700 (PDT) Subject: Re: snapbuild woes To: Andres Freund References: <20161212223338.bmhswrdaipttvcve@alap3.anarazel.de> <7023017e-8b08-eaba-396c-80baf0a793c0@2ndquadrant.com> <7286ebe9-cb1b-cf1a-f85b-fbe3402ea0bf@2ndquadrant.com> <9a897b86-46e1-9915-ee4c-da02e4ff6a95@2ndquadrant.com> <51f65289-54f8-2256-d107-937d662d69f1@2ndquadrant.com> <20170413002959.apytyi5lkknauauj@alap3.anarazel.de> <0d06dfc1-0bc5-c3ab-3555-24e2f275d7fa@2ndquadrant.com> <30242bc6-eca4-b7bb-670e-8d0458753a8c@2ndquadrant.com> <20170501005921.qcqd7w2njpv3av6s@alap3.anarazel.de> <20170501013529.sejtgo2acxbvq26q@alap3.anarazel.de> Cc: PostgreSQL-development , Erik Rijkers , Robert Haas , Craig Ringer From: Petr Jelinek Message-ID: <209861fc-718f-0a7b-3a1d-36512865c209@2ndquadrant.com> Date: Mon, 1 May 2017 03:54:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170501013529.sejtgo2acxbvq26q@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 01/05/17 03:35, Andres Freund wrote: > On 2017-04-30 17:59:21 -0700, Andres Freund wrote: >> ISTM, we need a xip_status array in SnapBuild->running. Then, whenever >> a xl_running_xacts is encountered while builder->running.xcnt > 0, loop >> for i in 0 .. xcnt_space, and end SnapBuildEndTxn() if xip_status[i] but >> the xid is not xl_running_xacts? Does that make sense? > > A hasty implementation, untested besides check-world, of that approach > is attached. I'm going out for dinner now, will subject it to mean > things afterwards. > > Needs more testing, comment and commit message policing. But I think > the idea is sound? > I agree with adding running, I think that's good thing even for the per transaction tracking and snapshot exports - we could use the newly added field to get rid of the issue we have with 'snapshot too large' when there were many aborted transactions while we waited for running ones to finish. Because so far only tracked committed transactions, any aborted one would show as running inside the exported snapshot so it can grow over maximum number of backends and can't be exported anymore. So +1 for that part. But, I still think we need to restart the tracking after new xl_running_xacts. Reason for that is afaics any of the catalog snapshots that we assigned to transactions at the end of SnapBuildCommitTxn might be corrupted otherwise as they were built before we knew one of the supposedly running txes was actually already committed and that transaction might have done catalog changes. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers