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 1vvW6H-005sAF-20 for pgpool-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 07:47:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvW6G-00Ak79-20 for pgpool-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 07:47:56 +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.96) (envelope-from ) id 1vvW6G-00Ak6v-1S for pgpool-hackers@lists.postgresql.org; Thu, 26 Feb 2026 07:47:56 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvW6D-00000001M2z-0qmc for pgpool-hackers@lists.postgresql.org; Thu, 26 Feb 2026 07:47:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=JfwOtxp/YRHMbCbteJuBIow1OHk6TTGUl/zT6EHzFjo=; b=e+ZuV+fvcOU2xlg3ma7Ql+YDlb l1VOyv4bbdmQu9WOHVBD5oKoT3GyDkZXx4D3BSQ8+4H46CMpMvDtb99rWlSDQR4CH0dSAwERYfO2U Cuy/7zvWKYaZM3vmeK7csfi7jnZQKvh970AKU/I/cW99aNFiS3T90FVJJGKw1+AIRjXCXazbZ460Y Ua6IWtU6dlgslj6LbyEmHttXY6Xtd7RZoU37WA99dLjgYVqnvCpV8q69KHe8gGGLJlQBjYcGozKzN P5+i9wv7JdqdOfnL1rFx89+AlBpvYYGIhR4AjaKuZx0NssEEXB7H6GAkmo+XCobz2IZ7BujLwpWx1 a1NsLgcQ==; Received: from [2409:11:4120:300:6134:22da:8275:cfb] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvW6A-0035PQ-2x; Thu, 26 Feb 2026 07:47:53 +0000 Date: Thu, 26 Feb 2026 16:47:42 +0900 (JST) Message-Id: <20260226.164742.1123136102374463742.ishii@postgresql.org> To: nadav@tailorbrands.com Cc: pgpool-hackers@lists.postgresql.org Subject: Re: Proposal: Recent mutated table tracking in memory From: Tatsuo Ishii In-Reply-To: References: <20260219.085121.1424536813757196179.ishii@postgresql.org> X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:6134:22da:8275:cfb (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Added some handling for possible causes - works now. Here are comments for the patch. - Some code lines are too long. We recommend to limit each source code line up to 78 chars. You can use following script to detect too long lines (you can ignore reports other than *.[c]) See https://wiki.postgresql.org/wiki/Committing_checklist git diff origin/master | grep -E '^(\+|diff)' | sed 's/^+//' | expand -t4 | awk "length > 78 || /^diff/" --- /dev/null +++ b/src/test/regression/tests/043.track_table_mutation_watchdog/.gitignore Please avoid to install .gitignore. .gitignore file are maintained by pgpool core developers. +++ b/src/test/regression/tests/043.track_table_mutation_watchdog/leader.conf To test watchdog, you should use the standard watchdog_setup too. +++ b/src/utils/pool_track_table_mutation.c +static inline void +query_cache_lock(void) "query_cache_*" is confusing since we already have query cache feature. Please use different name. +static int +track_table_mutation_get_database_oid_internal(void) +{ : : + /* Ensure we have a valid query context */ + if (session_context->query_context == NULL) + return oid; Why does this need? The query context is not used in this function. +/* ---------------- + * Public API implementation + * ---------------- + */ Please add a comments on what these function do. +Size +pool_track_table_mutation_shmem_size(void) +void +pool_track_table_mutation_init(void) +void +pool_track_table_mutation_child_init(void) +bool +pool_track_table_mutation_in_cold_start(void) +void +pool_track_table_mutation_trigger_global_cold_start(void) +bool +pool_track_table_mutation_table_is_stale(int table_oid, int dboid) __sync_fetch_and_add are old functions. I recommend to replace with ordinary statements using semaphore to protect the critical region. + __sync_fetch_and_add(&track_table_mutation_shmem->state.stats_queries_checked, 1); Please add a comments on what these function do. +pool_track_table_mutation_mark_tables_written(const int *table_oids, int num_tables, int dboid) +void +pool_track_table_mutation_update_ttl(uint64 delay_us) +bool +pool_track_table_mutation_get_cached_parse(uint64 hash, bool *is_write, +void +pool_track_table_mutation_cache_parse(uint64 hash, bool is_write, + const char table_names[][TRACK_TABLE_MUTATION_TABLE_NAME_LEN], + int num_tables) +uint64 +pool_track_table_mutation_normalize_and_hash(const char *query) Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp