Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks committed Jan 16, 2024
1 parent ac63f45 commit 21ff211
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion db/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ func (db *DatabaseCollectionWithUser) PutExistingCurrentVersion(ctx context.Cont
if existingDoc != nil {
doc, unmarshalErr := unmarshalDocumentWithXattr(ctx, newDoc.ID, existingDoc.Body, existingDoc.Xattr, existingDoc.UserXattr, existingDoc.Cas, DocUnmarshalRev)
if unmarshalErr != nil {
return nil, nil, "", base.HTTPErrorf(http.StatusBadRequest, "Error unmarshaling exsiting doc")
return nil, nil, "", base.HTTPErrorf(http.StatusBadRequest, "Error unmarshaling existing doc")
}
matchRev = doc.CurrentRev
}
Expand Down
2 changes: 1 addition & 1 deletion db/revision_cache_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func revCacheLoader(ctx context.Context, backingStore RevisionCacheBackingStore,
return revCacheLoaderForDocument(ctx, backingStore, doc, id.RevID)
}

// revCacheLoaderForCv will load a document from the bucket using the CV, comapre the fetched doc and the CV specified in the function,
// revCacheLoaderForCv will load a document from the bucket using the CV, compare the fetched doc and the CV specified in the function,
// and will still return revid for purpose of populating the Rev ID lookup map on the cache
func revCacheLoaderForCv(ctx context.Context, backingStore RevisionCacheBackingStore, id IDandCV, unmarshalBody bool) (bodyBytes []byte, body Body, history Revisions, channels base.Set, removed bool, attachments AttachmentsMeta, deleted bool, expiry *time.Time, revid string, err error) {
cv := Version{
Expand Down
8 changes: 4 additions & 4 deletions db/revision_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ func BenchmarkRevisionCacheRead(b *testing.B) {

// TestLoaderMismatchInCV:
// - Get doc that is not in cache by CV to trigger a load from bucket
// - Ensure the CV passed into teh GET operation won't match the doc in teh bucket
// - Ensure the CV passed into the GET operation won't match the doc in the bucket
// - Assert we get error and the value is not loaded into the cache
func TestLoaderMismatchInCV(t *testing.T) {
cacheHitCounter, cacheMissCounter, getDocumentCounter, getRevisionCounter := base.SgwIntStat{}, base.SgwIntStat{}, base.SgwIntStat{}, base.SgwIntStat{}
Expand All @@ -727,7 +727,7 @@ func TestLoaderMismatchInCV(t *testing.T) {
// - Now perform two concurrent Gets, one by CV and one by revid on a document that doesn't exist in the cache
// - This will trigger two concurrent loads from bucket in the CV code path and revid code path
// - In doing so we will have two processes trying to update lookup maps at the same time and a race condition will appear
// - In doing so will cause us to potentially have two of teh same elements the cache, one with nothing referencing it
// - In doing so will cause us to potentially have two of the same elements the cache, one with nothing referencing it
// - Assert after both gets are processed, that the cache only has one element in it and that both lookup maps have only one
// element
// - Grab the single element in the list and assert that both maps point to that element in the cache list
Expand Down Expand Up @@ -783,10 +783,10 @@ func TestGetActive(t *testing.T) {
Value: doc.Cas,
}

// remove the entry form the rev cache to force teh cache to not have the active version in it
// remove the entry form the rev cache to force the cache to not have the active version in it
collection.revisionCache.RemoveWithCV("doc", &expectedCV)

// call get active to get teh active version from the bucket
// call get active to get the active version from the bucket
docRev, err := collection.revisionCache.GetActive(base.TestCtx(t), "doc", true)
assert.NoError(t, err)
assert.Equal(t, rev1id, docRev.RevID)
Expand Down
2 changes: 1 addition & 1 deletion rest/replicatortest/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8348,6 +8348,6 @@ func TestReplicatorUpdateHLVOnPut(t *testing.T) {
assert.NoError(t, err)
uintCAS = base.HexCasToUint64(syncData.Cas)

// TODO: assert that the SourceID and Verison pair are preserved correctly pending CBG-3211
// TODO: assert that the SourceID and Version pair are preserved correctly pending CBG-3211
assert.Equal(t, uintCAS, syncData.HLV.CurrentVersionCAS)
}

0 comments on commit 21ff211

Please sign in to comment.