Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
e866fc2
save
FGasper Nov 28, 2025
81b5670
first commit
FGasper Nov 28, 2025
7fb0d1a
add test
FGasper Nov 28, 2025
12d8a85
track missing doc as mismatch
FGasper Nov 28, 2025
df7c1c2
linter
FGasper Nov 28, 2025
f972d31
save progress
FGasper Nov 28, 2025
b074f9f
add API
FGasper Nov 28, 2025
c32ea15
augment Progress API
FGasper Nov 28, 2025
e452319
string elapsed
FGasper Nov 28, 2025
c9be1ca
fix durations
FGasper Nov 28, 2025
edea418
tolerate no mismatches
FGasper Nov 28, 2025
489097a
huh??
FGasper Nov 28, 2025
d73f6cc
fix JSON names
FGasper Nov 28, 2025
7d6b4ce
add active workers
FGasper Nov 28, 2025
e82667c
Make phase dynamic - bug fix for restart
FGasper Nov 28, 2025
6b21175
replace lag w/ resume & cluster times
FGasper Nov 30, 2025
cb08989
currentTimes
FGasper Dec 1, 2025
65aa3ac
save
FGasper Dec 4, 2025
e9589bf
add test of GetBatch
FGasper Dec 4, 2025
9fd12c3
dedupe
FGasper Dec 4, 2025
d9294f2
remove trace-level command monitor
FGasper Dec 4, 2025
204dc85
Revert "remove trace-level command monitor"
FGasper Dec 4, 2025
7f45940
remove trace-level monitor
FGasper Dec 4, 2025
73c31a8
uncomment
FGasper Dec 4, 2025
ce4bb6b
renames
FGasper Dec 4, 2025
697f33a
document the /progress API
FGasper Dec 4, 2025
d161fa2
fix/detail docs
FGasper Dec 4, 2025
3cfa675
tidy
FGasper Dec 4, 2025
42cfc21
title detail
FGasper Dec 4, 2025
4bf7751
Merge branch 'REP-6873-nonempty-initial-change-stream' into REP-6875-…
FGasper Dec 4, 2025
0c850d9
round elapsed
FGasper Dec 4, 2025
3489030
Merge branch 'REP-6875-progress-api-detail' into REP-6875-progress-ap…
FGasper Dec 4, 2025
fd341cd
add priorMismatches
FGasper Dec 5, 2025
6c7626f
Merge branch 'REP-6875-progress-api-detail' into REP-6875-progress-ap…
FGasper Dec 5, 2025
a753d77
fix
FGasper Dec 5, 2025
c7df19a
Merge branch 'REP-6875-progress-api-detail' into REP-6875-progress-ap…
FGasper Dec 5, 2025
62c1d52
o panic
FGasper Dec 5, 2025
342ceeb
o panic
FGasper Dec 5, 2025
454633f
fix cast err
FGasper Dec 5, 2025
dc9e868
fix cast err
FGasper Dec 5, 2025
8df7fcb
fix mismatch counts
FGasper Dec 5, 2025
70504e9
Merge branch 'REP-6875-progress-api-detail' into REP-6875-progress-ap…
FGasper Dec 5, 2025
2e349c1
mapsome
FGasper Dec 5, 2025
b3a69ad
tweak counts
FGasper Dec 5, 2025
b69b87c
updates
FGasper Dec 5, 2025
34de406
move accumulations
FGasper Dec 5, 2025
eb81073
save
FGasper Dec 5, 2025
1c6f4f7
fix
FGasper Dec 5, 2025
b6a4389
dollar
FGasper Dec 5, 2025
a6e5eb5
thus far
FGasper Dec 6, 2025
a16753a
it builds!
FGasper Dec 6, 2025
a422ff4
fix
FGasper Dec 7, 2025
1cf3d89
save
FGasper Dec 7, 2025
2f406ec
fix marshal
FGasper Dec 7, 2025
846c544
more bson fix
FGasper Dec 7, 2025
fafa397
storing multiple mismatch times
FGasper Dec 7, 2025
20c251a
latest
FGasper Dec 8, 2025
8fca286
Convert
FGasper Dec 8, 2025
da02a39
Merge branch 'REP-6882-task-ids-rawvalue' into REP-6882-track-mismatc…
FGasper Dec 8, 2025
84d72c9
save
FGasper Dec 8, 2025
6c62927
tests should run now
FGasper Dec 8, 2025
b703419
remove persistent
FGasper Dec 8, 2025
f29586b
remove cryft
FGasper Dec 8, 2025
8b6ac52
accommodate hashed
FGasper Dec 8, 2025
93d6108
redo as facet
FGasper Dec 9, 2025
7b2509e
bad comment
FGasper Dec 9, 2025
5228aab
nits
FGasper Dec 9, 2025
7c537c4
order
FGasper Dec 9, 2025
f1bf031
switch
FGasper Dec 9, 2025
dde2a52
switch to a dedicated duration field
FGasper Dec 9, 2025
e0da337
yeah
FGasper Dec 9, 2025
73f49a6
Multiple NSS
FGasper Dec 9, 2025
d0e7dcf
unskip
FGasper Dec 9, 2025
b05e0ba
fix large ID
FGasper Dec 9, 2025
2140334
pertickler
FGasper Dec 9, 2025
d0fa5c7
Merge branch 'main' into REP-6882-track-mismatch-length
FGasper Dec 9, 2025
d0de07d
lint
FGasper Dec 9, 2025
2382bf2
fix final status
FGasper Dec 9, 2025
e88500a
abbrev
FGasper Dec 9, 2025
fb7e83d
track duration; add index
FGasper Dec 9, 2025
d083afd
only sort on unindexed field after limiting results
FGasper Dec 9, 2025
af60c3b
Revert "only sort on unindexed field after limiting results"
FGasper Dec 9, 2025
cfe8f90
solve race
FGasper Dec 9, 2025
c0894c9
remove cruft
FGasper Dec 9, 2025
bc4998d
add arg
FGasper Dec 9, 2025
329cbdf
remove
FGasper Dec 9, 2025
2d0b001
Revert "remove"
FGasper Dec 9, 2025
06c97b8
tweak docs & consolidate Slice
FGasper Dec 9, 2025
3d5fe2c
Merge branch 'main' into REP-6882-task-ids-rawvalue
FGasper Dec 9, 2025
f65e89a
Merge branch 'REP-6882-task-ids-rawvalue' into REP-6882-track-mismatc…
FGasper Dec 9, 2025
1a9725f
Merge branch 'main' into REP-6882-track-mismatch-length
FGasper Dec 10, 2025
260c34f
Merge branch 'main' into REP-6875-progress-api-detail-with-cs-fix
FGasper Dec 10, 2025
498b483
Merge branch 'REP-6882-track-mismatch-length' into REP-6875-progress-…
FGasper Dec 10, 2025
b9471c1
hmm maybe not
FGasper Dec 10, 2025
d4ac9d7
add max duration
FGasper Dec 10, 2025
43a09f6
simpler mismatch; moving along
FGasper Dec 10, 2025
581704c
fixes
FGasper Dec 10, 2025
3830640
determine total
FGasper Dec 10, 2025
3a80545
save fixes
FGasper Dec 11, 2025
9bad4d1
one brace
FGasper Dec 11, 2025
58959b2
add string
FGasper Dec 11, 2025
e1c7f44
fix bson
FGasper Dec 11, 2025
01cf93b
hide
FGasper Dec 11, 2025
fb2154c
Add agg library.
FGasper Dec 11, 2025
e008897
Add mbson changes.
FGasper Dec 11, 2025
4ac6c1e
Add changes
FGasper Dec 11, 2025
c577461
Merge branch 'REP-6882-track-mismatch-length' into REP-6875-progress-…
FGasper Dec 11, 2025
c048fab
un-rename
FGasper Dec 11, 2025
82ae9c8
remove spurious
FGasper Dec 11, 2025
367898b
fix typo
FGasper Dec 12, 2025
92d5776
Merge branch 'REP-6882-track-mismatch-length' into REP-6875-progress-…
FGasper Dec 12, 2025
382a274
fixhistory
FGasper Dec 12, 2025
585e348
Merge branch 'main' into REP-6875-progress-api-detail
FGasper Dec 18, 2025
888b1f8
moar docs
FGasper Dec 18, 2025
e6db943
gci
FGasper Dec 18, 2025
6182f6b
put back
FGasper Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,49 @@ metaURI: mongodb://localhost:28012
The verifier will now check to completion to make sure that there are no inconsistencies. The command you need to send the verifier here is `writesOff`. The command doesn’t block. This means that you will have to poll the verifier, or watch its logs, to see the status of the verification (see `progress`).

```
curl -H "Content-Type: application/json" -X POST -d '{}' http://127.0.0.1:27020/api/v1/writesOff
curl -H "Content-Type: application/json" -d '{}' http://127.0.0.1:27020/api/v1/writesOff
```


3. You can poll the status of the verification by hitting the `progress`endpoint. In particular, the `phase`should reveal whether the verifier is done verifying; once the `phase`is `idle`the verification has completed. When the `phase`has reached `idle`, the `error`field should be `null`and the `failedTasks`field should be `0`, if the verification was successful. A non-`null``error`field indicates that the verifier itself ran into an error. `failedTasks`being non-`0`indicates that there was an inconsistency. The logs printed by the verifier itself should have more information regarding what the inconsistencies are.

```
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:27020/api/v1/progress

```




This is a sample output when inconsistencies are present:
3. You can poll the status of the verification by hitting the `progress` endpoint. In particular, the `phase` should reveal whether the verifier is done verifying. Once the `phase` is `idle`, the verification has completed. At that point the `error` field should be `null`, and the `failedTasks` field should be `0`, if the verification was successful. A non-`null` `error` field indicates that the verifier itself ran into an error. `failedTasks` being non-`0` indicates that there was an inconsistency. See below for how to investigate mismatches.

```
curl http://127.0.0.1:27020/api/v1/progress
```

`{"progress":{"phase":"idle","error":null,"verificationStatus":{"totalTasks":1,"addedTasks":0,"processingTasks":0,"failedTasks":1,"completedTasks":0,"metadataMismatchTasks":0,"recheckTasks":0}}}`
### `/progress` API Response Contents

In the below a “timestamp” is an object with `T` and `I` unsigned integers.
These represent a logical time in MongoDB’s replication protocol.

- `progress`
- `phase` (string): either `idle`, `check`, or `recheck`
- `generation` (unsigned integer)
- `generationStats`
- `timeElapsed` (string, [Go Duration format](https://pkg.go.dev/time#ParseDuration))
- `activeWorkers` (unsigned integer)
- `docsCompared` (unsigned integer)
- `totalDocs` (unsigned integer)
- `srcBytesCompared` (unsigned integer)
- `totalSrcBytes` (unsigned integer, only present in `check` phase)
- `priorMismatches` (unsigned integer, optional, mismatches seen in prior generation)
- `mismatchesFound` (unsigned integer)
- `rechecksEnqueued` (unsigned integer)
- `srcChangeStats`
- `eventsPerSecond` (nonnegative float, optional)
- `currentTimes` (optional)
- `lastHandledTime` (timestamp)
- `lastClusterTime` (timestamp)
- `bufferSaturation` (nonnegative float)
- `dstChangeStats` (same fields as `srcChangeStats`)
- `error` (string, optional)
- `verificationStatus` (tasks for the current generation)
- `totalTasks` (unsigned integer)
- `addedTasks` (unsigned integer, unstarted tasks)
- `processingTasks` (unsigned integer, in-progress tasks)
- `failedTasks` (unsigned integer, tasks that found a document mismatch)
- `completedTasks` (unsigned integer, tasks that found no problems)
- `metadataMismatchTasks` (unsigned integer, tasks that found a collection metadata mismatch)


# CLI Options
Expand Down
47 changes: 0 additions & 47 deletions agg/agg.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,50 +171,3 @@ func (s Switch) D() bson.D {
func (s Switch) MarshalBSON() ([]byte, error) {
return bson.Marshal(s.D())
}

// ---------------------------------------------

type Map struct {
Input, As, In any
}

var _ bson.Marshaler = Map{}

func (m Map) D() bson.D {
return bson.D{
{"$map", bson.D{
{"input", m.Input},
{"as", m.As},
{"in", m.In},
}},
}
}

func (m Map) MarshalBSON() ([]byte, error) {
return bson.Marshal(m.D())
}

// ------------------------------------------

type Filter struct {
Input, As, Cond, Limit any
}

var _ bson.Marshaler = Filter{}

func (f Filter) D() bson.D {
d := bson.D{
{"input", f.Input},
{"as", f.As},
{"cond", f.Cond},
}

if f.Limit != nil {
d = append(d, bson.E{"limit", f.Limit})
}
return bson.D{{"$filter", d}}
}

func (f Filter) MarshalBSON() ([]byte, error) {
return bson.Marshal(f.D())
}
83 changes: 83 additions & 0 deletions agg/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func (s Slice) MarshalBSON() ([]byte, error) {
})
}

// ---------------------------------------------

type ArrayElemAt struct {
Array any
Index any
Expand All @@ -40,3 +42,84 @@ func (a ArrayElemAt) D() bson.D {
func (a ArrayElemAt) MarshalBSON() ([]byte, error) {
return bson.Marshal(a.D())
}

// ---------------------------------------------

type Size [1]any

var _ bson.Marshaler = Size{}

func (s Size) MarshalBSON() ([]byte, error) {
return bson.Marshal(bson.D{{"$size", s[0]}})
}

// ---------------------------------------------

type Map struct {
Input, As, In any
}

var _ bson.Marshaler = Map{}

func (m Map) D() bson.D {
return bson.D{
{"$map", bson.D{
{"input", m.Input},
{"as", m.As},
{"in", m.In},
}},
}
}

func (m Map) MarshalBSON() ([]byte, error) {
return bson.Marshal(m.D())
}

// ------------------------------------------

type Filter struct {
Input, As, Cond, Limit any
}

var _ bson.Marshaler = Filter{}

func (f Filter) D() bson.D {
d := bson.D{
{"input", f.Input},
{"as", f.As},
{"cond", f.Cond},
}

if f.Limit != nil {
d = append(d, bson.E{"limit", f.Limit})
}
return bson.D{{"$filter", d}}
}

func (f Filter) MarshalBSON() ([]byte, error) {
return bson.Marshal(f.D())
}

// ------------------------------------------

type Range struct {
Start any
End any
Step any // ignored if 0
}

var _ bson.Marshaler = Range{}

func (r Range) MarshalBSON() ([]byte, error) {
if r.Start == nil {
r.Start = 0
}

args := bson.A{r.Start, r.End}

if r.Step != nil {
args = append(args, r.Step)
}

return bson.Marshal(bson.D{{"$range", args}})
}
11 changes: 11 additions & 0 deletions agg/string.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package agg

import "go.mongodb.org/mongo-driver/v2/bson"

type ToString [1]any

var _ bson.Marshaler = ToString{}

func (ts ToString) MarshalBSON() ([]byte, error) {
return bson.Marshal(bson.D{{"$toString", ts[0]}})
}
Loading