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 1u4NN1-001H8C-2u for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Apr 2025 17:13:19 +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 1u4NMy-003ckk-Hu for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Apr 2025 17:13:17 +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.94.2) (envelope-from ) id 1u4NMy-003ci5-7d for pgsql-hackers@lists.postgresql.org; Mon, 14 Apr 2025 17:13:17 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u4NMw-0003Qr-33 for pgsql-hackers@postgresql.org; Mon, 14 Apr 2025 17:13:16 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-30bfd4d4c63so42457871fa.2 for ; Mon, 14 Apr 2025 10:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744650793; x=1745255593; darn=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=Jh3IOjnEA5hXb2gDQrGQTUR/shZnacC/9uPK9cGz/FI=; b=NSGoBJEw7g6Bh8lmAKvQJpVhy+1vZfF0rgpMnZFA6a+uH6ehvBxnZZ5UPVzQu0Waqa U5vAcBoknkxHXpCq1+kTIDISp8fthskBmARaMuSKnmLoCoXTZifFRTianT4BGWoRaPP4 M9EfiIu78G3PzL6hA4nH8t7KyY++Fa/ieu7Hwm6leOFSH2VPR7N83ateI/yLOCi128bj JrcglaOOA/kUwTRfH3tIVrrTWzOSkdGLh5BDtkDBbfpyVmWfnrBNG+0wMagwJmU2ZjJ7 w+AKETomv4+xBTtg+nYY3HHUJnxXRc6/gRepa5azT3h3/XGoAsZqPQ6qcs5tjfp4NAh4 1iOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744650793; x=1745255593; 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=Jh3IOjnEA5hXb2gDQrGQTUR/shZnacC/9uPK9cGz/FI=; b=I7rrv0puWb1gboAFxVsqrgWHISPTjIXoJGzJC8a5hshhK8wbiYdUUfb/KRh37I2cf1 Yx/BsyuHHosjCqAVCnWvYWsV6A+KvZV+vxyQ2xw+HqC+vUSZhzICkGX+b3AHHjH18DLR JKoYekgecoJr+y90mL4U+zoEp73opyFnaD2VMo1RUYaLos4//RFXo9hHSChbVlmVNuUc lfrlU1zkLfgRZ7A7vye132rG4wHFk2LQb4VU+cfTgfFNjsZuRWzV3qLoapkzR8+1joxa /S/GTHMgXYPENmRdluoHgXbrU2SuZ44+9wdYwxONkEBqyfNd8CsXw95C2B81RK1Tk890 fyrQ== X-Gm-Message-State: AOJu0YxhflgjIbFpGX/AQsJuNNoMHb08ge2qGfxd1iW6I20nkt8+g1cM MhsFE8PT8kG03zkjZQ9d/EJ7DRSW3aQV/55FIkypUW/MgxGY/hKtkgGJp4DxouoPM0SG0Uwa+CH pn/5sfLfRx+ld5V/ZObiah2WXHo2NQZSU X-Gm-Gg: ASbGnctZGAt8M5OYIXAgzlBRLAbrZoFYsr9RQOZQOucJCgiKsZ3q1pdk64h9mrZACwN NgiOdxoNYpdG+rFZPY3UknEZMW6rLRd14hjCSjFckDn3aZoidB/7rWJcbL9nIPN+ibsZAI03bFI i9xiI+nazeNBFqN1Dw03dKwpU3QuhV2jw= X-Google-Smtp-Source: AGHT+IGECV83sGIhsc7THW5GpOvTQX0FsyIrywdZRe4Sx2kESjXSCa5LFnmb83AlgJdVeEFrPwHs5LvOIY/zq69kPUU= X-Received: by 2002:a05:651c:12c8:b0:30b:8f60:cdb7 with SMTP id 38308e7fff4ca-31049a1c521mr40237331fa.24.1744650793169; Mon, 14 Apr 2025 10:13:13 -0700 (PDT) MIME-Version: 1.0 References: <117147.1744380740@localhost> In-Reply-To: <117147.1744380740@localhost> From: Sami Imseih Date: Mon, 14 Apr 2025 12:13:00 -0500 X-Gm-Features: ATxdqUEJsScd1jd5DTidZbRnFCkhZb09dlk3doHL-9YfFq0ddULOh56HCLFWV3I Message-ID: Subject: Re: Conflicting updates of command progress To: Antonin Houska Cc: pgsql-hackers@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 > While working on [1] I realized that some field of pg_stat_progress_cluste has > weird value. Is there a repro that you can share that shows the weird values? It sounds like the repro is on top of [1]. Is that right? > AFAICS the current design does not consider that one progress-reporting > command can be called by another one. pgstat_progress_start_command should only be called once by the entry point for the command. In theory, we could end up in a situation where start_command is called multiple times during the same top-level command; > Not sure what the correct fix is. We can > either ignore update requests from the "nested" commands, or display the There is a pattern where we do ``` if (progress) pgstat_progress_update_param ``` cluster_rel can pass down a flag to index_build or others that update progress to not report progress. Therefore, only the top level command is updating progress. what do you think? [1] https://commitfest.postgresql.org/patch/5117/ -- Sami Imseih Amazon Web Services (AWS)