Note problems.
authorRobert Haas <[email protected]>
Thu, 16 Jan 2014 15:30:52 +0000 (10:30 -0500)
committerRobert Haas <[email protected]>
Thu, 6 Feb 2014 14:23:00 +0000 (09:23 -0500)
src/backend/utils/mmgr/mspan.c

index 4463910ea78f8646f1b4f8069db3942428d6c6c9..3f289cd0c351df4f4ae06ebacc9c3b0ebd40f175 100644 (file)
@@ -683,6 +683,11 @@ mspan_release_span(char *base, mspan_manager *mgr, mspan *span)
                        span->first_page = preceding_span->first_page;
                        span->npages += preceding_span->npages;
                        mspan_destroy_span(base, preceding_span);
+                       /*
+                        * XXX. This is a problem.  Suppose we destroy the preceding span
+                        * and it releases a superblock just preceding the current span.
+                        * Now that span can't consolidate with this one nor visca versa.
+                        */
                }
        }
        if (mgr->npages == 0 || span->first_page + span->npages < mgr->boundary)
@@ -698,6 +703,10 @@ mspan_release_span(char *base, mspan_manager *mgr, mspan *span)
                        mspan_unlink_span(base, following_span);
                        span->npages += following_span->npages;
                        mspan_destroy_span(base, following_span);
+                       /*
+                        * XXX. Here again, destroying the following span could create
+                        * another free chunk that needs to be consolidated with this span.
+                        */
                }
        }