From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Properly terminate the array returned by GetLockConflicts(). |
Date: | 2015-01-29 22:20:30 |
Message-ID: | E1YGxRu-00065q-JJ@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Properly terminate the array returned by GetLockConflicts().
GetLockConflicts() has for a long time not properly terminated the
returned array. During normal processing the returned array is zero
initialized which, while not pretty, is sufficient to be recognized as
a invalid virtual transaction id. But the HotStandby case is more than
aesthetically broken: The allocated (and reused) array is neither
zeroed upon allocation, nor reinitialized, nor terminated.
Not having a terminating element means that the end of the array will
not be recognized and that recovery conflict handling will thus read
ahead into adjacent memory. Only terminating when hitting memory
content that looks like a invalid virtual transaction id. Luckily
this seems so far not have caused significant problems, besides making
recovery conflict more expensive.
Discussion: 20150127142713(dot)GD29457(at)awork2(dot)anarazel(dot)de
Backpatch into all supported branches.
Branch
------
REL9_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/76e962750f0b2557e6a356c35d7c66fe8fb263b0
Modified Files
--------------
src/backend/storage/lmgr/lock.c | 4 ++++
1 file changed, 4 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2015-01-29 22:20:33 | pgsql: Properly terminate the array returned by GetLockConflicts(). |
Previous Message | Andres Freund | 2015-01-29 22:20:27 | pgsql: Align buffer descriptors to cache line boundaries. |