Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion db/import_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (il *importListener) ImportFeedEvent(ctx context.Context, collection *Datab
il.importStats.ImportErrorCount.Add(1)
return
}
var cv cvExtractor
var cv *rawHLV
vv := rawDoc.Xattrs[base.VvXattrName]
if len(vv) > 0 {
cv = base.Ptr(rawHLV(vv))
Expand Down
17 changes: 17 additions & 0 deletions db/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1477,3 +1477,20 @@ func TestImportCancelOnDocWithCorruptSequenceOndemand(t *testing.T) {
}, 1)

}

func TestImportWithSyncCVAndNoVV(t *testing.T) {
db, ctx := setupTestDBWithOptionsAndImport(t, nil, DatabaseContextOptions{})
defer db.Close(ctx)

collection, ctx := GetSingleDatabaseCollectionWithUser(ctx, t, db)
docID := SafeDocumentName(t, t.Name())

_, doc, err := collection.Put(ctx, docID, Body{"foo": "baz"})
require.NoError(t, err)

err = collection.dataStore.RemoveXattrs(ctx, docID, []string{base.VvXattrName}, doc.Cas)
require.NoError(t, err)

base.RequireWaitForStat(t, db.DbStats.Database().Crc32MatchCount.Value, 1)

}