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 1m8H3s-0004zF-6c for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jul 2021 06:59:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m8H3r-0000C9-3n for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jul 2021 06:59:31 +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 1m8H3q-0000C1-PP for pgsql-hackers@lists.postgresql.org; Tue, 27 Jul 2021 06:59:30 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m8H3n-0000lv-P7 for pgsql-hackers@lists.postgresql.org; Tue, 27 Jul 2021 06:59:29 +0000 Received: by mail-ed1-x52d.google.com with SMTP id b7so13997888edu.3 for ; Mon, 26 Jul 2021 23:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QdSDlxnHHkmm9vQHqY1tK+r4nKtw+dNXvWxCtEegspY=; b=PnUTEUIL13Bq/6BsJ6UIknM3+UzQyMQrh860YCNBpS9xdYMXocLeev5TsORjmlPWab 3BazUFZrZKThCMbtaA/oUOVI07q4fr2DPZ/EYaCFA3r0y2zzX1JlTo31Z2gZYiRr6p3I pwimApqHC4hgI2eo0NDQm54QYXjgkzncJ1/diq7O23dQDd7d+QiI4m9sWZciFGyT7D/R TJyyK1Q2OtcIatnhzX8XJzN+xn5fvLqpMioGFrDcHes17NXB8dgOoaLxULEWZx2XBdfk g5NWOyWKJmYIgJMAjWj872wZ8ZWDIJEEMMPVzk6XlpsW/L9W1PmhH1PPW2tgYf9+0CUg JJ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QdSDlxnHHkmm9vQHqY1tK+r4nKtw+dNXvWxCtEegspY=; b=S3RGQdbOSh7On2iOacMvSQPzgg/YPAwPcPH0cfjKrdy8XDotOhNZZZQt0KL6Ii5AeK Qhh+rrWqAqFaqocTu9zoI4SUVN6Yo9mFO5hvQVxG2hw2PmdCCaKRiENsiXDYRojNgw9h lOlkMgz7ttZEFGgVBhVTF1hzm8svLofgmDVJ8uC6qAD2FlWFWPEwq2+41VONQJUiX1z5 nhPsB9zNQIsOTFVnz+Ls0sZvDKxT12V66PfxP2vrh9NazZvPi1b0IPHUBBxqyPI6hjg6 dw8J6JEBSZeic7BI/lrWYAjm7un+X6UAdNlYJsnfMKvhCLQGZooITg4u0Ytje3ZL2+VA JSfw== X-Gm-Message-State: AOAM532qyuYePPAZFwhE2IFqe9u8XRd+e13fGFA5Hu7r57RRqoxzw2H+ 3ZWO4zpEJ7L3KlVM7m147ZH9g5ommYLoMdEmVv0= X-Google-Smtp-Source: ABdhPJxt3u1Qf2wVi/e61KbSaSkwjBFuZKGd4t1RQYO4X3vdg/rw0Wysn22UCQB1KelEsTogct1FHRt+aPW+FM3hzBM= X-Received: by 2002:a05:6402:34e:: with SMTP id r14mr15363322edw.6.1627369165392; Mon, 26 Jul 2021 23:59:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ajin Cherian Date: Tue, 27 Jul 2021 16:59:14 +1000 Message-ID: Subject: Re: Failed transaction statistics to measure the logical replication progress To: "osumi.takamichi@fujitsu.com" Cc: "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 8, 2021 at 4:55 PM osumi.takamichi@fujitsu.com wrote: > Attached file is the POC patch for this. > Current design is to save failed stats data in the ReplicationSlot struct. > This is because after the error, I'm not able to access the ReorderBuffer object. > Thus, I chose the object where I can interact with at the ReplicationSlotRelease timing. I think this is a good idea to capture the failed replication stats. But I'm wondering how you are deciding if the replication failed or not? Not all cases of ReplicationSLotRelease are due to a failure. It could also be due to a planned dropping of subscription or disable of subscription. I have not tested this but won't the failed stats be updated in this case as well? Is that correct? regards, Ajin Cherian Fujitsu Australia