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
* 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)
* 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;
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]);
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];
*
* Copyright (c) 2016-2021, PostgreSQL Global Development Group
*
- * src/backend/access/conveyor/cbmodify.c
+ * src/backend/access/conveyor/cbxlog.c
*
*-------------------------------------------------------------------------
*/
/*
* 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)
/*
* 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)
/*
* 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.
{
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,
}
/*
- * 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
/*
* 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.
*/
* 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
* 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
* 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