Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqMMr-0007zc-3Q for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Sep 2017 16:42:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dqMMq-0004WZ-Ib for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Sep 2017 16:42:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dqMMp-0004W5-Pp for pgsql-bugs@postgresql.org; Fri, 08 Sep 2017 16:42:55 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dqMMi-0002Wb-7r for pgsql-bugs@postgresql.org; Fri, 08 Sep 2017 16:42:54 +0000 Received: by mail-wm0-x232.google.com with SMTP id f145so7317466wme.0 for ; Fri, 08 Sep 2017 09:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=j5t3jiP+jUXheen/XTARdippHKSRQSlRWo6/lv/XYSA=; b=HZCXF8DrU45HbaGtKdrZHQ+YoXJvk3kll7rb8DmatiwuDC1ihTuA3zy6d3daC2CDMO 7fftr2CQcztpDbEoyhf6OJi0RFxwitLrciuzIkTe0NZ4QKX9eQVT7lq/ltyMEEEg2F61 pvvga9hf9Zp3lGdgablscxNJoj0CeoERGdR8+Sd0G4+IWJ2qPMJfwIYL6piFVsQwMY/R OZcwK5VkCxIUg4OtwIA/0dD1berx2/CUqqi+ukz0NHflAZeNF792eIq1Y2soYzIhVtyE 0qcayyvtf7IZQnuok9Msvw6WL7HKy3Aotrzu2QSR/78XYZAjqoa3/SgSkVd7YiWeIebo +Jog== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=j5t3jiP+jUXheen/XTARdippHKSRQSlRWo6/lv/XYSA=; b=Lac2I8KhxDPmESyEbRZ/q0FnxsCEqTYjVWB/DyVxaRX+RHXpo8Q4WD/5TtCutc6ndX 4oIUqBqFUW2bmtxvKD/dZr4TfmwXLxCrJZJe452aKNcXsYpUx4L3cN5cPh3HKK2TRTe2 gPOxxXKUzpvIm4xe+t7MhoEiLB80vvs6aReplkukL+UxcmwAHVka/+LGxev4M1fVUXY0 8i3t6bfSl2w5Wf1OnA6UeT/OmgFt2P2gjEc6g+bKr3Wl0wO8c/a5ZuZtI2MJ8Ygc1LJT s9UsWsDygB+SRbK8ILtNuWEiQEZHJcW9x00ONeT4P9DH64KrkwkZ+OX4CydZaoRRYpOp 2htQ== X-Gm-Message-State: AHPjjUhRJH/uJcLgOo2A938N40L6hhTOYKzvLcl08P+fI2e4FJJ1E2Wv su2CG9tczxKjDc4VrTzR4V7TXA== X-Google-Smtp-Source: AOwi7QBEpbnVMLZxjynjqDorKhOjR1iWikfOzBXaizj3//dKEIxz+Bdf353Q+oYXGjL/od4x2BL68g== X-Received: by 10.28.107.76 with SMTP id g73mr1993487wmc.66.1504888966124; Fri, 08 Sep 2017 09:42:46 -0700 (PDT) Received: from alvin.alvh.no-ip.org (41.107.broadband10.iol.cz. [90.177.107.41]) by smtp.gmail.com with ESMTPSA id 30sm1345600wrm.33.2017.09.08.09.42.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Sep 2017 09:42:45 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 4D51F17A3; Fri, 8 Sep 2017 18:42:44 +0200 (CEST) Date: Fri, 8 Sep 2017 18:42:44 +0200 From: Alvaro Herrera To: "Wong, Yi Wen" Cc: Michael Paquier , Peter Geoghegan , "Wood, Dan" , "pgsql-bugs@postgresql.org" Subject: Re: Old row version in hot chain become visible after a freeze Message-ID: <20170908164244.5oi6rcvy5ut7dpkb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1504814554687.86636@amazon.com> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Wong, Yi Wen wrote: > There is actually another case where HEAPTUPLE_DEAD tuples may be kept and have > prepare_freeze skipped on them entirely. > > lazy_record_dead_tuple may fail to record the heap for later pruning > for lazy_vacuum_heap if there is already a sufficiently large number of dead tuples > in the array: Hmm, ouch, good catch. AFAICS this is a shouldn't-happen condition, since we bail out of the loop pessimistically as soon as we would be over the array limit if the next page were to be full of dead tuples (i.e., we never give the chance for overflow to actually happen). So unless I misunderstand, this could only fail if you give maint_work_mem smaller than necessary for one pageful of dead tuples, which should be about 1800 bytes ... If we wanted to be very sure about this we could add a test and perhaps abort the vacuum, but I'm not sure it's worth the trouble. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs