In vacuumlazy.c, VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL is described as being in ms on line 85, yet it is used on line 1759 in a call to pg_usleep, so is treated as microseconds rather than milliseconds.
As a result, the timeout during lazy_truncate_heap() is actually only 5ms long, not 5s long. So this looks to me like a bug, patch attached, for back-patching to 9.1 vacuum_lock_wait_ms.v1,patch Objections? Note that VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL is described as being in ms and is actually in ms, so no change there. I'm also wondering why we don't use lock_timeout when the user sets it? Not a bug, but patch attached anyway. vacuum_truncate_use_lock_timeout.v1.patch -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
vacuum_lock_wait_ms.v1.patch
Description: Binary data
vacuum_truncate_use_lock_timeout.v1.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers