Re: Unit tests for SLRU

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Unit tests for SLRU
Дата
Msg-id 6580B85C-7A6B-4E2B-B780-65D8CAC2153F@yesql.se
обсуждение исходный текст
Ответ на Unit tests for SLRU  (Aleksander Alekseev <aleksander@timescale.com>)
Список pgsql-hackers
> On 31 Mar 2022, at 16:30, Aleksander Alekseev <aleksander@timescale.com> wrote:

Thanks for hacking on increasing test coverage!

> While on it, I moved the Asserts() outside of SimpleLruInit().  It didn't seem
> to be a right place to check the IsUnderPostmaster value, and complicated the
> test implementation.

+ *
+ * Returns false if the cache didn't exist before the call, true otherwise.
  */
-void
+bool
 SimpleLruInit(SlruCtl ctl, const char *name, int nslots, int nlsns,

If we're changing the API to make it testable, that should be noted in the
comment and how the return value should be interpreted (and when it can be
ignored).  It also doesn't seem all that appealing that SimpleLruInit can
return false on successful function invocation, it makes for a confusing API.

--
Daniel Gustafsson        https://vmware.com/




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: pgsql: Add 'basebackup_to_shell' contrib module.