improve comment pgfruit
authorRobert Haas <rhaas@postgresql.org>
Mon, 10 Jul 2023 14:22:21 +0000 (10:22 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 10 Jul 2023 14:22:21 +0000 (10:22 -0400)
contrib/pgfruit/pgfruit.c

index 9a47611c660c7c24f9eb8ceca55d9aa774a39181..06e89d80193ce0174339812d50c86a88ea7684ba 100644 (file)
@@ -472,7 +472,11 @@ pgfruit_reread(int nhints, int *hinted_ids)
        UnlockDatabaseObject(RelationRelationId, RelationGetRelid(rel),
                                                 0, AccessExclusiveLock);
 
-       /* We also need a snapshot. */
+       /*
+        * We must take a snapshot AFTER performing the lock waits above, so
+        * that we can be certain of seeing the changes made by any concurrent
+        * transactions for which we may have just waited.
+        */
        snapshot = RegisterSnapshot(GetLatestSnapshot());
 
        /*