Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDwgH-000324-UT for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2020 21:22:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDwgG-00025T-JM for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2020 21:22:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDwgG-00025M-8E for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2020 21:22:04 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDwg9-0002vm-8N for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2020 21:22:03 +0000 Received: by mail-qk1-x730.google.com with SMTP id w186so4546196qkd.1 for ; Thu, 03 Sep 2020 14:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=JYdx85d89ysy982Iv9yahqD3MFzj6ohNAt8Am5lxvJQ=; b=dcNTvNv27eTAk3TnvEhWlSkaIbbzmc9C51lOa1iA4ZNPlEjsPUfLTPZFLBwoO/Dgd3 XyXngN0SjNma4KLABTxct42g6GIKLTZcDFgrrhBlsXotkqmt0j69a9q6ph/0CpiCJY0I pTGNIpMArLVUE2P5OoTL/5eUMs+dp6ZLwfXmhMF+KIFG6JsPFmoCIuDH8JU3hZQ2tuJP UY8xuJv8N6KtoF5j3ijblIbk88/zo+UhvcZ5gjhNQz/xhQKrPLJ/TMrLtAkEWj/3xSto ddGYLXlK9T20B5QXnU/gQCWMpT07+kb+obb/abJLMRDn0Ij6aidHuZQA55udbXPa6kl0 T4lQ== 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:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=JYdx85d89ysy982Iv9yahqD3MFzj6ohNAt8Am5lxvJQ=; b=e8Mixv+CKJdBomUKNEvXPVuLBdK/rrjCZEuhcIHYN3z77Xsb16A24f3VtvFSmhAsXl 889EMWRC3DUgPpIKqGnWP48qsvr7GOBhRhl2Mpfb1G9GHTuFsR6Rp8EVKa8J7VSiIAdf rKfTcJaTTT7E1kXpDie12oaO8H0xDELvGEhVuVUMfa9jG7+Vq15Htalgz0GblE4EBpai xYKidCSHmER4J852RuGVbTdZfhSxOsVgcsOpEi1xOAIgcsYr+YO8EtxcKQzZfv13AFrG ok5x+zGbOtE7BFJV7IslsMPW9OFNSZ2oLX3EH0oRMxTt2306w58nFXtOCOPx78WpkJps scEQ== X-Gm-Message-State: AOAM5313ggvhpMLlxB7bG5R+Eimm7WLgyCBRDYR1d6TzjL26JUOkjSie 06yDSlLlM1lGg8KtlpqUls9S++eNj3OO/r3/uHmnzmbPLZolrTtZlgVFCSjpl1MQJvkVPYzgSRX H+ZOsXIXYgl6BOZ4/yKVcW6GmlIH38uQm0JetLeYSRF3TtLdoDEA5JmA7qJfjMeRZKvuSdRNV5D TWOhUya2G5n4zfvjvG X-Google-Smtp-Source: ABdhPJzevO0dres/TFt4+9CkzN4TfhTepnCIOx1Oud+b8/lBgFnZM188o8xjagnELMUeDmK43ubqYg== X-Received: by 2002:a05:620a:7e9:: with SMTP id k9mr5276852qkk.415.1599168115218; Thu, 03 Sep 2020 14:21:55 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id p205sm2930232qke.2.2020.09.03.14.21.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 14:21:54 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D14562A0FB5; Thu, 3 Sep 2020 17:21:52 -0400 (-04) Date: Thu, 3 Sep 2020 17:21:52 -0400 From: Alvaro Herrera To: Pg Hackers Subject: report expected contrecord size Message-ID: <20200903212152.GA15319@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit A pretty minor issue: when reporting that WAL appears invalid because contrecord length doesn't match, we may as well print to the server log the value that we're expecting. Patch attached. -- Álvaro Herrera http://www.flickr.com/photos/alvherre/ --Kj7319i9nmIyA2yE Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="report-contrecord.patch" diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index 67996018da..b69cf80b59 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -464,8 +464,9 @@ XLogReadRecord(XLogReaderState *state, char **errormsg) total_len != (pageHeader->xlp_rem_len + gotlen)) { report_invalid_record(state, - "invalid contrecord length %u at %X/%X", + "invalid contrecord length %u (expected %lld) at %X/%X", pageHeader->xlp_rem_len, + (long long) total_len - gotlen, (uint32) (RecPtr >> 32), (uint32) RecPtr); goto err; } --Kj7319i9nmIyA2yE--