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.96) (envelope-from ) id 1viDp7-000xPH-1B for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 15:39:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viDp5-001ZMS-0a for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 15:39:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viDp4-001ZMH-2i for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 15:39:15 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viDp2-001RN9-14 for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 15:39:14 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-432755545fcso3181049f8f.1 for ; Tue, 20 Jan 2026 07:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1768923551; x=1769528351; darn=lists.postgresql.org; h=message-id:date:content-id:mime-version:comments:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AYxUYid/bdj42xvyECZXhXNWL6wJlbuwdWst9zfdMjw=; b=gQ1FpdnwPlIBYpAqPfn1gK1uQnziwQo1yLP4+SMBCn3iFlSR5hAHLsJb4SeV55A1K5 WBEMdVltZ4UzLMVgfMMZ3bJOg7OcnWD2biDkB0SGF1m9ez8PAmZfY7KLRjcL8Xg5WG+x m2nsfPNRzP7hn0XXh1qqaOIxHfn5KbheggEGMs+GVxP/+zPJ3Wf7MdhSDAWADvIwR0sq 7uSdYpYgxpquY5Hk2+yd6Dm1pJpiCHLcCHFyjP6MtZ4i6Me2lWG31JQWDdijBzaFizu+ q3jRlQF3qKvgqgTRFt8lPU5oipr1IOCyADEHovjG5LMV740rwQjvzZl6YmLcnq5vwizD GKoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768923551; x=1769528351; h=message-id:date:content-id:mime-version:comments:references :in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=AYxUYid/bdj42xvyECZXhXNWL6wJlbuwdWst9zfdMjw=; b=Ve3MGBr2vQdpNRjh8gKCaaCBaGaJ0aCwm+WUGhzKQHJCzVUMAct7Mzp3QT5xajVudc eXASjJSY25AWwd7mwanHzLoKyygL5gZbbM7JfKK0swPKNKP326qkZUaTu3V64ih1e+Kf rcRvw5wYV4BzXSj0sQtnTia7rOZ1CdaGKfini8dt7NHsC9DpG+AM/27iXSfl0W3ZpPzm KQNaAKdK5hR0hIKNrhOaWn7zknXay7zLPIelZYKR9v4g0QgVsIkQ2U7mg3Z7PRC9ZhYs aqWWFppvqru1Hy5DWQu/0Myt+S9fzoXRb+T3tIrAXliunCCUfURP4JK/30NOClWVE87B y6DQ== X-Forwarded-Encrypted: i=1; AJvYcCW2CbL+O2awTKlXd5tysEdONOq3Vq/fbnEQxC6VBLO7q1k+TZQcoMq/27Gw4Vnv9HtYwgsJSQcw4KNUWGa8@lists.postgresql.org X-Gm-Message-State: AOJu0Yxn5pFrQWUJs1iA1wMIKz/VCcTjKDUHDWROkCdh/1wcqonqboNr mMoLznQFWAHth9DDFJ3JNVhuBfK37XjnXZHUCRQbsWUyze8scOh4k3GvF7IA6gE0Rqo= X-Gm-Gg: AZuq6aLK0wKhR+YwOCOk8b39FdtBoTAO67pLo8Ewc23kVyW07yuUC/dpYLQ9rbck4JB wGriFghozRB3nlRXP6L5YbiQ0t4LJwJYPLfPWVqqW7Xsd86ALSct/Jk5MG+TWBgNVyxkrLacZEN QA9DYTk92PUPyftEFhLqGH/k/3WiRXV+kKLyIJ2SXVe5wet14cfrMMBNtrhh8bcmUpK493IxXGg PHtCsgKBto3l18K386MYkb/glDg2WBTrIOvVawGxepbkH8WsQGKrY3N/74H0vuKp0iUZCDczOcu Ub7lYcCMtY+Z6lnkDIXgSULKidDORhDtB7hsVijhBGpQPEgRUuu9nrDDvRG5mmwYCBrySJyvCpk AUg/CJNENrQCZ9UANU1WCB6OgH6eaO/Rw7e9ZXbPN0B0tkZvHMxIPztz5cThsiNH57OFHSB8ddx Js9kHsMj5pXev3emkiCOWUe+cf X-Received: by 2002:a05:6000:2382:b0:432:86a3:ef2e with SMTP id ffacd0b85a97d-4356998ad0dmr19000858f8f.21.1768923551355; Tue, 20 Jan 2026 07:39:11 -0800 (PST) Received: from localhost (109-81-168-246.rct.o2.cz. [109.81.168.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356996cecasm28033751f8f.26.2026.01.20.07.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 07:39:10 -0800 (PST) From: Antonin Houska To: Mihail Nikalayeu cc: Alvaro Herrera , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202512151349.vlq3mpfniyk3@alvherre.pgsql> <11247.1767609087@localhost> <11558.1767609632@localhost> <141054.1767891540@localhost> <137668.1768235610@localhost> Comments: In-reply-to Mihail Nikalayeu message dated "Mon, 12 Jan 2026 21:20:35 +0300." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <73629.1768923550.1@localhost> Date: Tue, 20 Jan 2026 16:39:10 +0100 Message-ID: <73630.1768923550@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mihail Nikalayeu wrote: > > if (size >= MaxAllocSize) > Seems like we lost that check, I think it may be executed on storing > the data The tuple we process in store_change was created elsewhere (I think in reorderbuffer.c), so I wouldn't re-check the size here. > or before "tup = (HeapTuple) palloc(HEAPTUPLESIZE + t_len);" > in apply_concurrent_changes It's essentially the same length that we write in store_change() so I wouldn't bother re-checking it here. In general, I doubt the constant is appropriate. Its meaning is much more generic than the size of memory for a tuple and even heap_form_tuple() does not use it. > > bool done; > I still think it is a confusing name. I don't. The last call of process_concurrent_changes() tells the worker "Give me the the next batch and we are done". Your proposal "exit_after_lsn_upto" seems to me too verbose: the worker itself is supposed to know that it has to reach the LSN passed via another argument. > > chgdst.file_seq = WORKER_FILE_SNAPSHOT + 1; > I think it is better to increment it once a snapshot is received. The 'chgdst' is only defined in rebuild_relation_finish_concurrent(), no need to use it where the snapshot is received (in rebuild_relation()). > And rename to last_processed/last_improrted to be aligned with > last_exported. While DecodingWorkerShared deals with multiple files (not all of them necessarily available for "consumer") and therefore it makes sense to distinguish if file is exported or not, each instance of ChangeDest is assigned particular file and the functions using it do not care if the file is the last in the sequence or not. Other proposals accepted, will be reflected in the next version. -- Antonin Houska Web: https://www.cybertec-postgresql.com