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 1nbip4-0007pj-66 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2022 13:02:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbip2-0005kh-Vs for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2022 13:02:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbip2-0005kR-9d for pgsql-hackers@lists.postgresql.org; Tue, 05 Apr 2022 13:02:12 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nbioz-00005h-J6 for pgsql-hackers@postgresql.org; Tue, 05 Apr 2022 13:02:10 +0000 Received: by mail-ej1-x62b.google.com with SMTP id bg10so26579183ejb.4 for ; Tue, 05 Apr 2022 06:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=FUNAic7Nr97sKCFTxTc7SIirepjB4Be6bvgPSrr3D34=; b=D3B2oQB6DJvsV00B7rCR1fJrSx9jycogzsfFNRZF9ZQYI3+ERBtzo+/WGrD6bU0miO kiWj9W0KMaKBHPEWCKLrSqWEg0H6/xGCLTusmR9zMwsi7tSYg1aZlo5MXgOOFNzuzmwA QwnJhJE5PFRDSnjlDjGM65eepC+yemsQ69KalZoB9GeanLld7yZbNlhH41PN8pLdsL+i Yk4lEZ/pzuEvy4ad7s73awYVUZzDWu2potkN6qC1kR8WXY2w2CoRn6gFXBA2oiRBGaTp xgsRh9rqFtL2McpleknoGmtFRe39F9BCvM9i4PdXXilkql5tL7bU+JaEyWUDPKZPQJ/9 CCDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=FUNAic7Nr97sKCFTxTc7SIirepjB4Be6bvgPSrr3D34=; b=A7+McY74E5esbYXQbll28LEEk8JQgIq8SyAZAGEbeDsLiuubJAD4CgEYQ3rw85mAMP t4KUUsUOiRP8QfxUYYp1uxAFsgytq/9WGbCNkEH30YkCEMdUqkUAP/6O0PVkuGYGlTX2 rZ6ygcfoPKQPESoYkkFVljnQ2kESAeNn8ArY20p6jMf0W3XKnKn020yn9+GOYVOSQ78i Y5Dbkb4cdwIKXvBuyAizMcbGz8llpbuUHCieVN4OmKh7XhskImUthRPrCxWrJDRzUw90 0Kz7M5+fVzaN85jXMTvqaItgWuUSOKwKy1MF4xc+5o3PIbR85MSKuBbA2n4B7HZtkrnP HqIw== X-Gm-Message-State: AOAM533LWrP6uWWVxdiI0MlnA1kSAyXkHJeAFj8wty+HPvxIoDQmn8Ot BiRwpS92MTrlJazCLxzTmmGYzWECarSkCy/AzsJloAWQ6TsnEGV1kbV6ROkmw7mlM9lt5iN6KtJ VqXdwdD3Slo81xrRm5huwt0amtSgBLRZDvIVSBslkKeR7OFBT1kjkDDGUWV0klk37EUWvAa3+7e ShmElIVkxiC1yjLu7/HIkZRLBXk2GonM2Lbc07 X-Google-Smtp-Source: ABdhPJywG2jNcDQkqQfMK4R9EV2efEmVOW6qNxJPFJzLUbywgOSkCvZ9Wea9ZwwM9KHIpOBUu8BeXw== X-Received: by 2002:a17:907:2cc3:b0:6da:e6cb:2efa with SMTP id hg3-20020a1709072cc300b006dae6cb2efamr3493467ejc.169.1649163723855; Tue, 05 Apr 2022 06:02:03 -0700 (PDT) Received: from [10.80.18.155] ([145.40.212.39]) by smtp.gmail.com with ESMTPSA id gn1-20020a1709070d0100b006e012aaa918sm5416695ejc.139.2022.04.05.06.02.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 06:02:03 -0700 (PDT) Message-ID: Date: Tue, 5 Apr 2022 15:02:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: API stability [was: pgsql: Fix possible recovery trouble if TRUNCATE overlaps a checkpoint.] Content-Language: en-US To: Robert Haas , pgsql-hackers@postgresql.org References: From: Markus Wanner In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24.03.22 20:32, Robert Haas wrote: > Fix possible recovery trouble if TRUNCATE overlaps a checkpoint. This patch changed the delayChkpt field of struct PGPROC from bool to int. Back-porting this change could be considered an API breaking change for extensions using this field. I'm not certain about padding behavior of compilers in general (or standards requirements around that), but at least on my machine, it seems sizeof(PGPROC) did not change, so padding led to subsequent fields still having the same offset. Nonetheless, the meaning of the field itself changed. And the additional assert now also triggers for the following pseudo-code of the extension I'm concerned about: /* * Prevent checkpoints being emitted in between additional * information in the logical message and the following * prepare record. */ MyProc->delayChkpt = true; LogLogicalMessage(...); /* Note that this will also reset the delayChkpt flag. */ PrepareTransaction(...); Now, I'm well aware this is not an official API, it just happens to be accessible for extensions. So I guess the underlying question is: What can extension developers expect? Which parts are okay to change even in stable branches and which can be relied upon to remain stable? And for this specific case: Is it worth reverting this change and applying a fully backwards compatible fix, instead? Regards Markus Wanner