Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beryllium: fix misspell typos #6648

Merged
merged 4 commits into from
Jan 19, 2024
Merged
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/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,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 @@ -698,7 +698,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 @@ -722,7 +722,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 @@ -778,10 +778,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
5 changes: 4 additions & 1 deletion rest/replicatortest/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8325,6 +8325,8 @@ func TestReplicatorUpdateHLVOnPut(t *testing.T) {
// Grab the bucket UUIDs for both rest testers
activeBucketUUID, err := activeRT.GetDatabase().Bucket.UUID()
require.NoError(t, err)
passiveBucketUUID, err := passiveRT.GetDatabase().Bucket.UUID()
require.NoError(t, err)

const rep = "replication"

Expand All @@ -8351,6 +8353,7 @@ 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
assert.Equal(t, passiveBucketUUID, syncData.HLV.SourceID)
assert.Equal(t, uintCAS, syncData.HLV.CurrentVersionCAS)
assert.Equal(t, uintCAS, syncData.HLV.Version)
}