From fad6af03d7105f705b521b64fb7bbdfecf6d4adb Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Tue, 4 Feb 2020 18:20:20 +1300 Subject: [PATCH 3/3] Inject random faults into dsm_create(). Testing patch, not for commit. --- src/backend/storage/ipc/dsm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index ef64d08357..6220acc79d 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -463,6 +463,13 @@ dsm_create(Size size, int flags) nitems = dsm_control->nitems; for (i = 0; i < nitems; ++i) { + /* BEGIN HACK */ + if (random() % 10 > 5) + { + nitems = dsm_control->maxitems; + break; + } + /* END HACK */ if (dsm_control->item[i].refcnt == 0) { dsm_control->item[i].handle = seg->handle; -- 2.23.0