#include "storage/smgr.h"
#include "utils/catcache.h"
#include "utils/inval.h"
+#include "utils/memdebug.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/relmapper.h"
msg.cc.id = (int8) id;
msg.cc.dbId = dbId;
msg.cc.hashValue = hashValue;
+ /*
+ * Define padding bytes in SharedInvalidationMessage structs to be
+ * defined. Otherwise the sinvaladt.c ringbuffer, which is accessed by
+ * multiple processes, will cause spurious valgrind warnings about
+ * undefined memory being used. That's because valgrind remembers the
+ * undefined bytes from the last local process's store, not realizing that
+ * another process has written since, filling the previously uninitialized
+ * bytes
+ */
+ VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
+
AddInvalidationMessage(&hdr->cclist, &msg);
}
msg.cat.id = SHAREDINVALCATALOG_ID;
msg.cat.dbId = dbId;
msg.cat.catId = catId;
+ /* check AddCatcacheInvalidationMessage() for an explanation */
+ VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
+
AddInvalidationMessage(&hdr->cclist, &msg);
}
msg.rc.id = SHAREDINVALRELCACHE_ID;
msg.rc.dbId = dbId;
msg.rc.relId = relId;
+ /* check AddCatcacheInvalidationMessage() for an explanation */
+ VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
+
AddInvalidationMessage(&hdr->rclist, &msg);
}
msg.sn.id = SHAREDINVALSNAPSHOT_ID;
msg.sn.dbId = dbId;
msg.sn.relId = relId;
+ /* check AddCatcacheInvalidationMessage() for an explanation */
+ VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
+
AddInvalidationMessage(&hdr->rclist, &msg);
}
msg.sm.backend_hi = rnode.backend >> 16;
msg.sm.backend_lo = rnode.backend & 0xffff;
msg.sm.rnode = rnode.node;
+ /* check AddCatcacheInvalidationMessage() for an explanation */
+ VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
+
SendSharedInvalidMessages(&msg, 1);
}
msg.rm.id = SHAREDINVALRELMAP_ID;
msg.rm.dbId = databaseId;
+ /* check AddCatcacheInvalidationMessage() for an explanation */
+ VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
+
SendSharedInvalidMessages(&msg, 1);
}