Fix typos and address other review comments from Amul. conveyor
authorRobert Haas <[email protected]>
Tue, 4 Jan 2022 19:10:42 +0000 (14:10 -0500)
committerRobert Haas <[email protected]>
Tue, 4 Jan 2022 19:12:34 +0000 (14:12 -0500)
src/backend/access/conveyor/README
src/backend/access/conveyor/cbmetapage.c
src/backend/access/conveyor/cbxlog.c
src/backend/access/conveyor/conveyor.c
src/include/access/cbfsmpage_format.h
src/include/access/cbindexpage_format.h
src/include/access/cbmetapage_format.h

index a500a1cdbc096c5f9e5e260b777bb49b3466e840..2c562024239208f5d2cb17385c533817325db30a 100644 (file)
@@ -156,7 +156,7 @@ be bad, but it's not a functional breakage.
 
 Note also that running multiple copies of ConveyorBeltVacuum on the same
 conveyor belt at the same time is a bad plan. They'll contend with each
-othr trying to do the same work. Consider preventing this by some means
+other trying to do the same work. Consider preventing this by some means
 (e.g. a self-exclusive heavyweight lock).
 
 ConveyorBeltPhysicalTruncate can be used to return disk space to the
index 15021e092be44d54e1bd62ab4bbcddd263feab9e..7e9b95f070d813f71852c3cb2d528005966c813e 100644 (file)
@@ -304,8 +304,7 @@ cb_metapage_get_bounds(CBMetapageData *meta, CBPageNo *oldest_logical_page,
  * existing entries point to segments that are completely full. If we
  * needed to know how many entries had been filled in, whether or not any
  * of the associated storage was in use, we could do that by adding 1 to
- * the value computed here here if the entry at that offset is already
- * initialized.
+ * the value computed here if the entry at that offset is already initialized.
  */
 int
 cb_metapage_get_index_entries_used(CBMetapageData *meta)
@@ -552,7 +551,7 @@ cb_metapage_get_obsolete_state(CBMetapageData *meta,
         * of the index, or follows it by less than the number of pages per
         * segment. In the latter case, some but not all of the pages in the
         * oldest payload segment are obsolete. We can only clean up entire
-        * payload semgents, so in such cases there is nothing to do.
+        * payload segments, so in such cases there is nothing to do.
         */
        if (istart + pps > olpage)
                return CBM_OBSOLETE_NOTHING;
@@ -615,7 +614,7 @@ cb_metapage_clear_obsolete_index_entry(CBMetapageData *meta,
                                                                           CBSegNo segno,
                                                                           unsigned offset)
 {
-       if (meta->cbm_index[offset] != offset)
+       if (meta->cbm_index[offset] != segno)
                elog(ERROR,
                         "index entry at offset %u was expected to be %u but found %u",
                         offset, segno, meta->cbm_index[offset]);
@@ -659,7 +658,7 @@ cb_metapage_get_fsm_bit(CBMetapageData *meta, CBSegNo segno)
        uint8           byte;
        uint8           mask;
 
-       if (segno >= CB_METAPAGE_FREESPACE_BYTES * BITS_PER_BYTE)
+       if (segno >= CB_FSM_SEGMENTS_FOR_METAPAGE)
                elog(ERROR, "segment %u out of range for metapage fsm", segno);
 
        byte = meta->cbm_freespace_map[segno / BITS_PER_BYTE];
index 2dd030c1ac773ca3ed1247f866218f216ff315ac..76ba5214ac71722f6a438f085685cc0360dac857 100644 (file)
@@ -9,7 +9,7 @@
  *
  * Copyright (c) 2016-2021, PostgreSQL Global Development Group
  *
- * src/backend/access/conveyor/cbmodify.c
+ * src/backend/access/conveyor/cbxlog.c
  *
  *-------------------------------------------------------------------------
  */
index 090fccc3c0c729546d068332982bc8673b62d69f..e4ae06876805e3800a0449e3ba898b4156392a36 100644 (file)
@@ -656,7 +656,7 @@ ConveyorBeltGetNewPage(ConveyorBelt *cb, CBPageNo *pageno)
 /*
  * Actually insert a new page into the conveyor belt.
  *
- * See ConveyorBeltGetNewPage for the intended usage of this fucntion.
+ * See ConveyorBeltGetNewPage for the intended usage of this function.
  */
 void
 ConveyorBeltPerformInsert(ConveyorBelt *cb, Buffer buffer)
@@ -715,7 +715,7 @@ ConveyorBeltPerformInsert(ConveyorBelt *cb, Buffer buffer)
 /*
  * Clean up following the insertion of a new page into the conveyor belt.
  *
- * See ConveyorBeltGetNewPage for the intended usage of this fucntion.
+ * See ConveyorBeltGetNewPage for the intended usage of this function.
  */
 void
 ConveyorBeltCleanupInsert(ConveyorBelt *cb, Buffer buffer)
@@ -1050,7 +1050,7 @@ ConveyorBeltVacuum(ConveyorBelt *cb)
 
                /*
                 * If on the previous pass through the loop we concluded that we need
-                * to free a payload segment refrenced by the metapage and if that no
+                * to free a payload segment referenced by the metapage and if that no
                 * longer seems like the thing we need to do, then release any lock and
                 * pin we may have acquired in preparation for freeing that payload
                 * segment.
@@ -1276,7 +1276,7 @@ ConveyorBeltClearIndexSegmentEntries(ConveyorBelt *cb, Buffer metabuffer,
                {
                        if (segoff == 0)
                                elog(ERROR,
-                                        "conveyor belt index page at segno %u offset 0 should be initialied",
+                                        "conveyor belt index page at segno %u offset 0 should be initialized",
                                         index_segment);
                        if (*next_index_segment != CB_INVALID_SEGMENT)
                                elog(ERROR,
@@ -1432,7 +1432,7 @@ ConveyorBeltClearIndexSegmentEntries(ConveyorBelt *cb, Buffer metabuffer,
 }
 
 /*
- * Attempt to remve the oldest index segment.
+ * Attempt to remove the oldest index segment.
  *
  * The return value is the segment number of the oldest index segment that
  * remains after the operation has been completed. If no index segments remain
@@ -1960,7 +1960,7 @@ ConveyorSearchFSMPages(ConveyorBelt *cb, CBSegNo next_segment,
                /*
                 * Somehow this FSM page, which at last check was beyond the last
                 * allocated segment, now has no bits free whatsoever.  Either we've
-                * been asleep for an extrordinarily long time while a huge amount of
+                * been asleep for an extraordinarily long time while a huge amount of
                 * other work has happened, or the data on disk is corrupted, or
                 * there's a bug.
                 */
index 2c072c41a6d18b5f54e030fc872a02a9c03f9d67..5a32a75f91221ad4c402e05bb72375c46027093e 100644 (file)
@@ -4,7 +4,7 @@
  *       Actual on-disk format for a conveyor-belt FSM page.
  *
  * Backend code should not typically include this file directly, even if
- * it's code that is part of the conveyor belt implemenation. Instead, it
+ * it's code that is part of the conveyor belt implementation. Instead, it
  * should use the interface routines defined in cbfsmpage.h.
  *
  * See src/backend/access/conveyor/README for a general overview of
index 904ad9771425807916a3794a32994db58d65ad31..d8d29076302ed347a0204192a9d3551892a570e4 100644 (file)
@@ -4,7 +4,7 @@
  *       Actual on-disk format for a conveyor-belt index page.
  *
  * Backend code should not typically include this file directly, even if
- * it's code that is part of the conveyor belt implemenation. Instead, it
+ * it's code that is part of the conveyor belt implementation. Instead, it
  * should use the interface routines defined in cbindexpage.h.
  *
  * See src/backend/access/conveyor/README for a general overview of
index a39ab44949b93d722ac83fe35157eb839ba3ba36..ab973d67e5cb55f3c94f296df038a61bf1db6795 100644 (file)
@@ -4,7 +4,7 @@
  *       Actual on-disk format for a conveyor-belt metapage.
  *
  * Backend code should not typically include this file directly, even if
- * it's code that is part of the conveyor belt implemenation. Instead, it
+ * it's code that is part of the conveyor belt implementation. Instead, it
  * should use the interface routines defined in cbmetapage.h.
  *
  * See src/backend/access/conveyor/README for a general overview of