Re: subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData
Date
Msg-id CANP8+jLE=CS4jEMcVV7i0w3PMAnL=niZ3m7Bss84ogK1v=z47Q@mail.gmail.com
Whole thread Raw
In response to subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 7 May 2015 at 21:40, Michael Paquier <michael.paquier@gmail.com> wrote:
Hi all,

Coverity is complaining about the following assertion introduced in
commit 924bcf4 (parallel stuff, SerializeSnapshot@snapmgr.c):
+       Assert(snapshot->xcnt >= 0);

Now the thing is that this assertion does not make much sense, because
SnapshotData defines subxcnt as uint32 in snapshot.h. While we could
simply remove this assertion, I am wondering if we could not change
subxcnt to uint32 instead.

SnapshotData has been introduced in 2008 by d43b085, with this comment:
+       int32           subxcnt;                /* # of xact ids in
subxip[], -1 if overflow */
Comment regarding negative values removed in efc16ea5.

Now, by looking at the code on HEAD, I am seeing no code paths that
make use of negative values of subxcnt. Perhaps I am missing
something?

So the comment is wrong? It does not set to -1 at overflow anymore?
 
--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Obsolete mention of src/tools/backend
Next
From: Fabien COELHO
Date:
Subject: Re: commitfest app bug/feature