You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FallbackColumn is a global default to fallback to and is less specific than the
384
-
// default, which is the Primary Key
388
+
// default, which is the Primary Key.
389
+
// This column MUST have unique values (ideally a unique constraint) for data integrity.
385
390
FallbackColumnstring
386
391
}
387
392
@@ -727,10 +732,15 @@ type Config struct {
727
732
//
728
733
ForceIndexForVerificationForceIndexConfig
729
734
730
-
// Ghostferry requires a single numeric column to paginate over tables. Inferring that column is done in the following exact order:
735
+
// Ghostferry requires a single numeric or binary column to paginate over tables. Inferring that column is done in the following exact order:
731
736
// 1. Use the PerTable pagination column, if configured for a table. Fail if we cannot find this column in the table.
732
-
// 2. Use the table's primary key column as the pagination column. Fail if the primary key is not numeric or is a composite key without a FallbackColumn specified.
737
+
// 2. Use the table's primary key column as the pagination column. Fail if the primary key is not numeric/binary or is a composite key without a FallbackColumn specified.
733
738
// 3. Use the FallbackColumn pagination column, if configured. Fail if we cannot find this column in the table.
739
+
//
740
+
// IMPORTANT: The pagination column MUST contain unique values for data integrity.
741
+
// When using a FallbackColumn (typically "id") for tables with composite primary keys, this column must have a unique constraint.
742
+
// The pagination algorithm uses WHERE pagination_key > last_key ORDER BY pagination_key LIMIT batch_size.
743
+
// If duplicate values exist, rows may be skipped during iteration, resulting in data loss during the migration.
// BatchSize is a pointer to the BatchSize in Config.UpdatableConfig which can be independently updated from this code.
43
43
// Having it as a pointer allows the updated value to be read without needing additional code to copy the batch size value into the cursor config for each cursor we create.
44
44
BatchSize*uint64
@@ -47,7 +47,7 @@ type CursorConfig struct {
47
47
}
48
48
49
49
// returns a new Cursor with an embedded copy of itself
0 commit comments