Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u4NrW-001NXx-TD for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Apr 2025 17:44:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u4NrU-003zjY-4c for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Apr 2025 17:44:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u4NrT-003zjJ-RA for pgsql-hackers@lists.postgresql.org; Mon, 14 Apr 2025 17:44:48 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u4NrQ-0004MG-2k for pgsql-hackers@lists.postgresql.org; Mon, 14 Apr 2025 17:44:48 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-3106217268dso15791531fa.1 for ; Mon, 14 Apr 2025 10:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744652683; x=1745257483; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PNDSfVflhW2OlbRw40TDk03CCPkWr7gFrQhFvgvHIYI=; b=UAK0dLBFB2eqbgtrI+Q3iAaDBQYHOXoEyvmDH9NiI0QH5XjUvaHwbR54R1ETQT184m pTL59X3KXHVUxCBHZJDOidfREfrTfG0G8JA3NmvaELxVL6BYkQCrYnxxYpS7L3vbDf+p VggN4esnAToACFniFAlyMjqrxYJF2esNTs+80vYO5UbWZ73G6ZhrPMuLO0wsXLdSbotC rDA8Nd9e0+/taIAdrmOyGbISnEWZI0nPffRcqJThGEfoUQddh54E9U5CmLuNoQbf25gd S3fgm6z4fh7brhXlY4gGlFSwl7AVCS4QtFy+nNWNj+DQq8MKSqg4XCqoWcEylElvqUqF /jOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744652683; x=1745257483; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PNDSfVflhW2OlbRw40TDk03CCPkWr7gFrQhFvgvHIYI=; b=NlV4n9AiwvsusAZ8NIBUQbOV8JI3SGYyTDTf+ZJl/vadj/d6hqGx+JBtviWJiAJVdH qjBjxKtqRPe2exrNdNrpYrtOVqh460rk3h1t+7zvvHsP1w7A8IulDCukS/OkQFIHVUgY W4p4YqTRPYCO3KHMd8jLaB/XxONn+rdVorhOmvEQbJ+8o39KtZiaUuKpDWQvFKhw2MTf xDo5yy73yf93R6RSHTR45727+L11OapmWLhAn9mhsIDGGK9/M7Gr+tK5O7HdxRfRix2Q 14/XZGqG3SRSMqE+9gLBJIAvMuNaMeAxAviLx0cSqB51JNlbQ9fIUaimdTg+fiiIIwUJ 6J+A== X-Gm-Message-State: AOJu0YzvXx14OQvTYqDof7bPbOJ9USk6I+KSjoUiOj1vxPprbFHHegqf YDxo730y2EBtYRZvfSICNsjT0+0iGsgXYgV3JENSvMQlIZSNoDxQ2myxotnojilYBPrZbo8x2Or 79hawoM4w00fnS8weVMCwRoeaPsg= X-Gm-Gg: ASbGnctKEWpytgzW35M9HQXJdWzoaoqJK8nXeUCe3JcS5+lVrdLBV7TxmSjt98aU/kQ n9PhKo1t/j5+yOdvKsA6gvgWRyjcQwSuiqBVYiYjL+go9+KFGma11gfGJqjFacF140OCQlrh7z6 KH2vZNRfCM3fg7bo9liVayFShQL/K3FuBXSzk= X-Google-Smtp-Source: AGHT+IE8JjQMKgvAbqkgKwTUjLN57X5YntMYK0Ad27NS9HZAcRidPekftlogJ2Z4bLoEiKKU1T0/2Ze5S6f3esl+eMU= X-Received: by 2002:a05:651c:1994:b0:308:eb58:6591 with SMTP id 38308e7fff4ca-31049a62501mr42967001fa.25.1744652683165; Mon, 14 Apr 2025 10:44:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Mon, 14 Apr 2025 22:44:32 +0500 X-Gm-Features: ATxdqUHp7G1TlVRKJfscn2ZXIAHB6De9OUGAksUgnikLSRxvf2oCiS7IZrnYOeU Message-ID: Subject: Re: Built-in Raft replication To: Konstantin Osipov 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 Mon, 14 Apr 2025 at 22:15, Konstantin Osipov wrote: > > Hi, Hi > I am considering starting work on implementing a built-in Raft > replication for PostgreSQL. > Just some thought on top of my mind, if you need my voice here: I have a hard time believing the community will be positive about this change in-core. It has more changes as contrib extension. In fact, if we want a built-in consensus algorithm, Paxos is a better option, because you can use postgresql as local crash-safe storage for single decree paxos, just store your state (ballot number, last voice) in a heap table. OTOH Raft needs to write its own log, and what's worse, it sometimes needs to remove already written parts of it (so, it is not appended only, unlike WAL). If you have a production system which maintains two kinds of logs with different semantics, it is a very hard system to maintain.. There is actually a prod-ready (non open source) implementation of RAFT as extension, called BiHA, by pgpro. Just some thought on top of my mind, if you need my voice here. -- Best regards, Kirill Reshke