injection_points: Fix incrementation of variable-numbered stats The pending entry was not used when incrementing its data, directly manipulating the shared memory pointer, without even locking it. This could mean losing statistics under concurrent activity. The flush callback was a no-op.
This code serves as a base template for extensions for the custom cumulative statistics, so let's be clean and use a pending entry for the incrementations, whose data is then flushed to the corresponding entry in the shared hashtable when all the stats are reported, in its own flush callback. Author: Sami Imseih <samims...@gmail.com> Discussion: https://postgr.es/m/caa5rz0v0u0yhpby+bqchomkpbyurrq3rqxnzf_sb-svdiqo...@mail.gmail.com Backpatch-through: 18 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/39f67d9b554fcd6dfb6c4f02a4af757eecd1fecf Modified Files -------------- src/test/modules/injection_points/injection_stats.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)