Re: statement_timeout is not working as expected with postgres_fdw
tushar <tushar.ahuja@enterprisedb.com>
From: tushar <tushar.ahuja@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>,
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Suraj Kharage <suraj.kharage@enterprisedb.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-05-04T10:34:20Z
Lists: pgsql-hackers
On 05/04/2017 03:53 PM, tushar wrote: > We can see statement_timeout is working but it is taking some extra > time,not sure this is an expected behavior in above case or not. This is only when remote server is involved . in case when both the servers are on the same machine , then this is working as expected. d1=# CREATE SERVER myserver_ppas FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'localhost', dbname 'postgres', port '5432', connect_timeout '3'); CREATE SERVER d1=# CREATE USER MAPPING FOR centos SERVER myserver_ppas OPTIONS (user 'centos', password 'adminedb'); CREATE USER MAPPING d1=# create foreign table ft_test_ppas (a int ) server myserver_ppas options (table_name 'test1'); CREATE FOREIGN TABLE d1=# d1=# insert into ft_test_ppas values (1); INSERT 0 1 Case 1- d1=# \timing Timing is on. d1=# set statement_timeout =6000; SET Time: 0.360 ms d1=# insert into ft_test_ppas values (generate_series(1,10000000)); ERROR: canceling statement due to statement timeout Time: 6002.509 ms (00:06.003) d1=# Case 2 - d1=# set statement_timeout =20000; SET Time: 0.693 ms d1=# insert into ft_test_ppas values (generate_series(1,10000000)); ERROR: canceling statement due to statement timeout Time: 20001.741 ms (00:20.002) d1=# -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company
Commits
-
postgres_fdw: Allow cancellation of transaction control commands.
- fc267a0c3c65 9.3.18 landed
- c02c450cfc0f 9.4.13 landed
- b7665f079092 9.5.8 landed
- fd849956cc71 9.6.4 landed
- ae9bfc5d6512 10.0 landed
-
Allow queries submitted by postgres_fdw to be canceled.
- cdf5a004bb7c 9.5.7 landed
- f14bf0a8fdd5 9.4.12 landed
- 3aa16b117a28 9.3.17 landed
- f039eaac7131 9.6.0 cited
-
Fix multiple problems in postgres_fdw query cancellation logic.
- 1b812afb0eaf 9.6.0 cited