On Fri, May 8, 2015 at 10:27 PM, Simon Riggs wrote:
> On 8 May 2015 at 13:02, Michael Paquier wrote:
>> I think that we should redefine subxcnt as uint32 for consistency with
>> xcnt, and remove the two assertions that 924bcf4 has introduced. I
>> could get a patch quickly done FWIW.
>
> (uint32) +1
Attached is the patch. This has finished by being far simpler than
what I thought first.
Regards,
--
Michael
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index a2cb4a0..e1ca52c 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -168,7 +168,7 @@ typedef struct SerializedSnapshotData
TransactionId xmin;
TransactionId xmax;
uint32 xcnt;
- int32 subxcnt;
+ uint32 subxcnt;
bool suboverflowed;
bool takenDuringRecovery;
CommandId curcid;
@@ -1480,9 +1480,6 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
{
SerializedSnapshotData *serialized_snapshot;
- Assert(snapshot->xcnt >= 0);
- Assert(snapshot->subxcnt >= 0);
-
serialized_snapshot = (SerializedSnapshotData *) start_address;
/* Copy all required fields */
diff --git a/src/include/utils/snapshot.h b/src/include/utils/snapshot.h
index a734bf0..d37ff0b 100644
--- a/src/include/utils/snapshot.h
+++ b/src/include/utils/snapshot.h
@@ -85,7 +85,7 @@ typedef struct SnapshotData
* out any that are >= xmax
*/
TransactionId *subxip;
- int32 subxcnt; /* # of xact ids in subxip[] */
+ uint32 subxcnt; /* # of xact ids in subxip[] */
bool suboverflowed; /* has the subxip array overflowed? */
bool takenDuringRecovery; /* recovery-shaped snapshot? */
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers