Skip to content

Commit d4797bb

Browse files
wt-vendoring-bot[bot]MongoDB Bot
authored andcommitted
Import wiredtiger: f70f842661e270f090ef4d9fb8a079641bbac5b7 from branch mongodb-7.0 (#33290)
GitOrigin-RevId: 22de4224817882f71e5e9e1260e33b079ab40a06
1 parent 4bcb25d commit d4797bb

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

src/third_party/wiredtiger/import.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"vendor": "wiredtiger",
33
"github": "wiredtiger/wiredtiger",
44
"branch": "mongodb-7.0",
5-
"commit": "f237d5ab195c47fcd577cd5259a2b732e5922304"
5+
"commit": "f70f842661e270f090ef4d9fb8a079641bbac5b7"
66
}

src/third_party/wiredtiger/test/format/format.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ typedef struct {
242242

243243
char *config_open; /* Command-line configuration */
244244

245-
TABLE *base_mirror; /* First mirrored table */
245+
TABLE *base_mirror; /* First mirrored table */
246+
bool mirror_col_store; /* Special case if mirroring column store table */
246247

247248
RWLOCK backup_lock; /* Backup running */
248249
uint64_t backup_id; /* Block incremental id */

src/third_party/wiredtiger/test/format/format_config.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,10 +1157,13 @@ config_mirrors(void)
11571157
char buf[100];
11581158
bool already_set, explicit_mirror;
11591159

1160+
g.mirror_col_store = false;
11601161
/* Check for a CONFIG file that's already set up for mirroring. */
11611162
for (already_set = false, i = 1; i <= ntables; ++i)
11621163
if (NTV(tables[i], RUNS_MIRROR)) {
11631164
already_set = tables[i]->mirror = true;
1165+
if (tables[i]->type == FIX || tables[i]->type == VAR)
1166+
g.mirror_col_store = true;
11641167
if (g.base_mirror == NULL && tables[i]->type != FIX)
11651168
g.base_mirror = tables[i];
11661169
}
@@ -1250,7 +1253,8 @@ config_mirrors(void)
12501253
tables[i]->mirror = true;
12511254
config_single(tables[i], "runs.mirror=1", false);
12521255
g.base_mirror = tables[i];
1253-
1256+
if (tables[i]->type == VAR)
1257+
g.mirror_col_store = true;
12541258
/*
12551259
* Pick some number of tables to mirror, then turn on mirroring the next (n-1) tables, where
12561260
* allowed.
@@ -1261,6 +1265,8 @@ config_mirrors(void)
12611265
if (tables[i] != g.base_mirror) {
12621266
tables[i]->mirror = true;
12631267
config_single(tables[i], "runs.mirror=1", false);
1268+
if (tables[i]->type == FIX || tables[i]->type == VAR)
1269+
g.mirror_col_store = true;
12641270
if (--mirrors == 0)
12651271
break;
12661272
}

src/third_party/wiredtiger/test/format/ops.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,24 @@ ops(void *arg)
11631163
tinfo->last += range;
11641164
if (tinfo->last > max_rows)
11651165
tinfo->last = 0;
1166+
/*
1167+
* Edge case: There is a case where we cannot detect a proper mirror mismatch.
1168+
* Say we truncated the tail end key range of all the mirrors from N to
1169+
* max_rows. This truncate happened before any thread added another non-mirrored
1170+
* append/insert to a column store table and the data in that truncated key
1171+
* range was sufficient to delete the pages at the end of the column store
1172+
* table. Then when a column store non-mirrored insert happened, it appended the
1173+
* new item at key N instead of at max_rows + 1. Then the next mirror check will
1174+
* detect a mismatch from the row-store table because the appended value does
1175+
* not match the truncated value.
1176+
*
1177+
* We want to test truncate at the end of the range as much as possible, so
1178+
* adjust the end range to max_rows - 1 only in the case where we are mirroring
1179+
* and have a column store table.
1180+
*/
1181+
if (g.base_mirror != NULL && g.mirror_col_store &&
1182+
(tinfo->last == 0 || tinfo->last == max_rows))
1183+
tinfo->last = max_rows - 1;
11661184
}
11671185
} else {
11681186
if (TV(BTREE_REVERSE)) {

0 commit comments

Comments
 (0)