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 1u7XYw-001Awu-46 for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Apr 2025 10:42:42 +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 1u7XYt-005QtL-M8 for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Apr 2025 10:42:40 +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 1u7XYt-005QtD-9g for pgsql-hackers@lists.postgresql.org; Wed, 23 Apr 2025 10:42:40 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u7XYr-001WHk-1H for pgsql-hackers@postgresql.org; Wed, 23 Apr 2025 10:42:38 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43cf3192f3bso61297535e9.1 for ; Wed, 23 Apr 2025 03:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1745404956; x=1746009756; darn=postgresql.org; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to; bh=4/9qPQk3A9wfAaOb7rW9OsynNK8L08wVFDMQdlcZEMI=; b=QPgCT5AWYt5KVPx2QOwAJSLJ+4r9enLocAOk9c9vqmZYMeOMFNIRTe25nw9Meekygy Nbgne4TkjA8geDW8rYZ+ukD8LJRfz9KiThGUu05EIO4wYAE6y/f3vJ4J+ktOOlYpYVA3 y5M1ozIoW7uleJ42qoFyNwZXtWGz9tZN6fHArC7SQh19hKgFK+hKSA6+QLj7a7svAWaM PfwKxwlVUv33LovSBofJOwSyhkTUSLe4g2xbXkme3XdB15DnzSFJ9F4sFbU/8W6VnXza HDI2MubKgDpNJlzHuPuW9BDSjsy3f1g91Bv44PBYC6oEXnJC/83ZakfA7+r5kRQP/5y4 uwjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745404956; x=1746009756; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4/9qPQk3A9wfAaOb7rW9OsynNK8L08wVFDMQdlcZEMI=; b=tD2rcvQuJqO4fkELrMrjOonXEBgvv6jIMzFwzg9TG3kf4Mrf7DoIpZc7wFlPWZYLzx eZCKY39ww4kgNLMJuPwkurkzD+CQMp0fFwyq56t9gPwV2yr4OjEH95wts/ekBuO2EsrI yLUjrk3D5NRYNt3yTralbBfojJwzhjSlAmktiIWSlWfL+blUh+OW4cFN7AYONnBQUP3s /m6Wo36RA1k1HhZD2N1fSiLkSScM/GQcmRNEcDnBoIAqDGuTwGUsSrV6BL8sGsiari++ ea7NCYFSkNZctrWURHj8/byoidM9BGPDfR/DRlwspmGTt2vYoPRzddhfSZLAjdIJg1BD 4x9A== X-Forwarded-Encrypted: i=1; AJvYcCWWZsjnLdGrA+KkfpdsYI0UJ7K0AhuEhK5/4ZuSIcoNyqCTsRzP9i9/HZkmkbB68on39ovrkqE5IW0sVU5H@postgresql.org X-Gm-Message-State: AOJu0YxLPL5JU5ncWdNM5ukcBoXZrZ12EEsMCndXY/qaygHiwC2iOYct oqp6F3b96pwYtriXLp2/nSy/s+jDxIQx7mgpEejphZQYTeQAzhaqsBsZWkDYoMp4BwLN4Myyaub b X-Gm-Gg: ASbGncut9ovGZfk1F8D6BuLiibwrQRnsf6MSzn6fZwFr38d9uA+BsAXAQrnge3sJCmT rQVE7gvzyOx5lcGnI28rZpOoVvbnnftulwcUa+qy7euQu3t6KmrWmJvPdeZwLHUKdvwxAElDjqv nJGwJP6VkBQwNRtOLV2ybpmVxZIj5l2VpLQ3LMsCT86Pb7djGWy3W6bQEnWx0f7INLzXxMXPbo7 wATomx27ZPblhY78+Rv6QgSYFh+t0+Fqh6Y4Y4fR07Tcl2GDWZlDWiLW+8aYr8ThSlENqmxHltg /1EYVeO/EDuEBU97o9KxfvuBYi2Q2wLaEO2VF9kTA+j7XWiqBT8w X-Google-Smtp-Source: AGHT+IFLv3hlA4QY5rrScfOvjxm38LN7Whyn5k+bSmMZyDcj4lqdi23rOS8v4XB1Kr3L0ydFDmTk4g== X-Received: by 2002:a05:600c:1ca0:b0:43c:fcbc:9680 with SMTP id 5b1f17b1804b1-4406abfa9demr131628915e9.25.1745404956394; Wed, 23 Apr 2025 03:42:36 -0700 (PDT) Received: from localhost (109-81-174-36.rct.o2.cz. [109.81.174.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4408c7d6ccdsm34550495e9.0.2025.04.23.03.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 03:42:36 -0700 (PDT) From: Antonin Houska To: Fujii Masao cc: Sami Imseih , pgsql-hackers@postgresql.org Subject: Re: Conflicting updates of command progress In-reply-to: References: <117147.1744380740@localhost> Comments: In-reply-to Fujii Masao message dated "Tue, 15 Apr 2025 16:07:07 +0900." 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: <17870.1745404955.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Apr 2025 12:42:35 +0200 Message-ID: <17871.1745404955@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fujii Masao wrote: > On 2025/04/15 2:13, Sami Imseih wrote: > >> While working on [1] I realized that some field of pg_stat_progress_c= luste has > >> weird value. > = > I ran into the same issue while working on [2], and eventually had to > withdraw that patch because of it. Have you considered reporting the progress of each command separately? I think that can be implemented by moving the progress related fields from PgBackendStatus into a new structure and by teaching the backend to insert= a new instance of that structure into a shared hash table (dshash.c) wheneve= r a command that needs progress reporting is being started. pgstat.c uses such a hash table for various statistics objects, however it= 's probably not a good idea to adjust this infrastructure by simply adding a = new object kind (e.g. PGSTAT_KIND_COMMAND). I think that pgstat.c is designed = for frequent updates of backend-local statistics and less frequent flushes (e.g. at command completion) to the shared memory. That's not suitable for progress reporting. > [2] https://commitfest.postgresql.org/patch/5282/ -- = Antonin Houska Web: https://www.cybertec-postgresql.com