Re: suppressing useless wakeups in logical/worker.c
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Thomas Munro <thomas.munro@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2023-03-17T00:22:55Z
Lists: pgsql-hackers
Attachments
I've attached a minimally-updated patch that doesn't yet address the bigger topics under discussion. On Thu, Mar 16, 2023 at 03:30:37PM +0530, Amit Kapila wrote: > On Wed, Feb 1, 2023 at 5:35 AM Nathan Bossart <nathandbossart@gmail.com> wrote: >> On Sat, Jan 28, 2023 at 10:26:25AM +0530, Amit Kapila wrote: >> > BTW, do we need to do something about wakeups in >> > wait_for_relation_state_change()? >> >> ... and wait_for_worker_state_change(), and copy_read_data(). From a quick >> glance, it looks like fixing these would be a more invasive change. > > What kind of logic do you have in mind to avoid waking up once per > second in those cases? I haven't looked into this too much yet. I'd probably try out Tom's suggestions from upthread [0] next and see if those can be applied here, too. >> TBH >> I'm beginning to wonder whether all this is really worth it to prevent >> waking up once per second. > > If we can't do it for all cases, do you see any harm in doing it for > cases where we can achieve it without adding much complexity? We can > probably add comments for others so that if someone else has better > ideas in the future we can deal with those as well. I don't think there's any harm, but I'm also not sure it does a whole lot of good. At the very least, I think we should figure out something better than the process_syncing_tables() hacks before taking this patch seriously. [0] https://postgr.es/m/3220831.1674772625%40sss.pgh.pa.us -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
-
Improve TimestampDifferenceMilliseconds to cope with overflow sanely.
- 3a28d7808928 16.0 landed
-
Code review for commit 05a7be935.
- 24ff700f6aee 16.0 landed