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

Add storageID to tier_fs #8549

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions pkg/catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func createPrepareUncommittedTestScenario(t *testing.T, repositoryID string, num
var expectedRecords []string
if numBranches > 0 {
test.RefManager.EXPECT().GetCommit(gomock.Any(), gomock.Any(), gomock.Any()).MinTimes(1).Return(&graveler.Commit{}, nil)
test.CommittedManager.EXPECT().List(gomock.Any(), gomock.Any(), gomock.Any()).MinTimes(1).Return(cUtils.NewFakeValueIterator([]*graveler.ValueRecord{}), nil)
test.CommittedManager.EXPECT().List(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).MinTimes(1).Return(cUtils.NewFakeValueIterator([]*graveler.ValueRecord{}), nil)
}
for i := 0; i < numBranches; i++ {
branchID := graveler.BranchID(fmt.Sprintf("branch%04d", i))
Expand Down Expand Up @@ -889,7 +889,7 @@ func createPrepareUncommittedTestScenario(t *testing.T, repositoryID string, num
sort.Slice(diffs[i], func(ii, jj int) bool {
return bytes.Compare(diffs[i][ii].Key, diffs[i][jj].Key) < 0
})
test.CommittedManager.EXPECT().Diff(gomock.Any(), repository.StorageNamespace, gomock.Any(), branches[i].CompactedBaseMetaRangeID).MinTimes(1).Return(gUtils.NewDiffIter(diffs[i]), nil)
test.CommittedManager.EXPECT().Diff(gomock.Any(), gomock.Any(), repository.StorageNamespace, gomock.Any(), branches[i].CompactedBaseMetaRangeID).MinTimes(1).Return(gUtils.NewDiffIter(diffs[i]), nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we expect the correct storageID here and in other places?

}
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/graveler/committed/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,20 @@ func Test_import(t *testing.T) {
}
}
metaRangeManager := mock.NewMockMetaRangeManager(ctrl)
metaRangeManager.EXPECT().NewWriter(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(writer)
metaRangeManager.EXPECT().NewWriter(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(writer)
sourceMetaRangeID := tst.sourceRange.GetMetaRangeID()
destMetaRangeID := tst.destRange.GetMetaRangeID()
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), graveler.MetaRangeID("")).AnyTimes().Return(committed.NewEmptyIterator(), nil) // empty base
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), sourceMetaRangeID).AnyTimes().Return(createIter(tst.sourceRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), destMetaRangeID).AnyTimes().Return(createIter(tst.destRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), gomock.Any(), graveler.MetaRangeID("")).AnyTimes().Return(committed.NewEmptyIterator(), nil) // empty base
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), gomock.Any(), sourceMetaRangeID).AnyTimes().Return(createIter(tst.sourceRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), gomock.Any(), destMetaRangeID).AnyTimes().Return(createIter(tst.destRange), nil)

rangeManager := mock.NewMockRangeManager(ctrl)

writer.EXPECT().Abort().AnyTimes()
metaRangeId := graveler.MetaRangeID("import")
writer.EXPECT().Close(gomock.Any()).Return(&metaRangeId, nil).AnyTimes()
committedManager := committed.NewCommittedManager(metaRangeManager, rangeManager, params)
_, err := committedManager.Import(ctx, "ns", destMetaRangeID, sourceMetaRangeID, tst.prefixes)
_, err := committedManager.Import(ctx, "", "ns", destMetaRangeID, sourceMetaRangeID, tst.prefixes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may indicate a TODO: Import will need to support multiple storages, may as well mark that we'll test it here (or elsewhere; depends on how you plan to do that).

if !errors.Is(err, expectedResult.expectedErr) {
t.Fatalf("Import error = '%v', expected '%v'", err, expectedResult.expectedErr)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/graveler/committed/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type iterator struct {
rng *Range // Decoded value at which rangeIt point
it graveler.ValueIterator // nil at start of range
err error
storageID StorageID
namespace Namespace
beforeRange bool
}
Expand All @@ -32,7 +33,7 @@ func NewIterator(ctx context.Context, manager RangeManager, namespace Namespace,
// loadIt loads rvi.it to start iterating over a new range. It returns false and sets rvi.err
// if it fails to open the new range.
func (rvi *iterator) loadIt() bool {
it, err := rvi.manager.NewRangeIterator(rvi.ctx, rvi.namespace, rvi.rng.ID)
it, err := rvi.manager.NewRangeIterator(rvi.ctx, rvi.storageID, rvi.namespace, rvi.rng.ID)
if err != nil {
rvi.err = fmt.Errorf("open range %s: %w", rvi.rng.ID, err)
return false
Expand Down
4 changes: 2 additions & 2 deletions pkg/graveler/committed/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestIterator(t *testing.T) {
key = committed.Key(p.Keys[len(p.Keys)-1])
}
manager.EXPECT().
NewRangeIterator(gomock.Any(), gomock.Eq(namespace), committed.ID(key)).
NewRangeIterator(gomock.Any(), gomock.Any(), gomock.Eq(namespace), committed.ID(key)).
Return(makeRangeIterator(p.Keys), nil)
lastKey = key
}
Expand All @@ -195,7 +195,7 @@ func TestIterator(t *testing.T) {
key = committed.Key(p.Keys[len(p.Keys)-1])
}
manager.EXPECT().
NewRangeIterator(gomock.Any(), gomock.Eq(namespace), committed.ID(key)).
NewRangeIterator(gomock.Any(), gomock.Any(), gomock.Eq(namespace), committed.ID(key)).
Return(makeRangeIterator(p.Keys), nil).
AnyTimes()
lastKey = key
Expand Down
63 changes: 32 additions & 31 deletions pkg/graveler/committed/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ func NewCommittedManager(m MetaRangeManager, r RangeManager, p Params) graveler.
}
}

func (c *committedManager) Exists(ctx context.Context, ns graveler.StorageNamespace, id graveler.MetaRangeID) (bool, error) {
return c.metaRangeManager.Exists(ctx, ns, id)
func (c *committedManager) Exists(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, id graveler.MetaRangeID) (bool, error) {
return c.metaRangeManager.Exists(ctx, storageID, ns, id)
}

func (c *committedManager) Get(ctx context.Context, ns graveler.StorageNamespace, rangeID graveler.MetaRangeID, key graveler.Key) (*graveler.Value, error) {
it, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, rangeID)
func (c *committedManager) Get(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, rangeID graveler.MetaRangeID, key graveler.Key) (*graveler.Value, error) {
it, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, rangeID)
if err != nil {
return nil, err
}
Expand All @@ -53,16 +53,16 @@ func (c *committedManager) Get(ctx context.Context, ns graveler.StorageNamespace
return rec.Value, nil
}

func (c *committedManager) List(ctx context.Context, ns graveler.StorageNamespace, rangeID graveler.MetaRangeID) (graveler.ValueIterator, error) {
it, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, rangeID)
func (c *committedManager) List(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, rangeID graveler.MetaRangeID) (graveler.ValueIterator, error) {
it, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, rangeID)
if err != nil {
return nil, err
}
return NewValueIterator(it), nil
}

func (c *committedManager) WriteRange(ctx context.Context, ns graveler.StorageNamespace, it graveler.ValueIterator) (*graveler.RangeInfo, error) {
writer, err := c.RangeManager.GetWriter(ctx, Namespace(ns), nil)
func (c *committedManager) WriteRange(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, it graveler.ValueIterator) (*graveler.RangeInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please rename ns to namespace?
So at least in the context of this manager, the term StorageID will always be attached to Namespace.

(Here, and in every function that have ns.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hear what you're saying, but I don't think we should try to go into graveler and try to make all the names conform to some coding convention- that's not the goal of this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the goal, but a side-effect. Renaming it to namespace will help us maintain the code in its new form (that's including storageID).
It's a simple search-and-replace in this file that will improve its readability and align with our general code style of this repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is like tabs/spaces. You end up with a commit war over code-style nonsense that's a huge waste of everyone's time.

ns is an acceptable variable name for Go: https://www.reddit.com/r/golang/comments/3aporh/why_so_many_gophers_use_single_letter_variables/

I prefer a little more descriptive names, but I'm not going to go through our whole codebase and start correcting other people's naming

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So at least rename storageID to sid to keep the same convention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can both be right!

  1. We can decide that "ns" is a "familiar variable name". Reddit is not authoritative; the Google Go Style Guide is, and this is the section on abbreviated naming. Single letters are encouraged in receivers, and abbreviations are cool for a few other cases. I am not convinced that "ns" fits these, but I have no strong feelings.
  2. We should definitely not do this renaming in this PR, it is already quite large. It is perfectly acceptable to decide and then do this in a separate PR, either before or after this one. But not as part of this one.

writer, err := c.RangeManager.GetWriter(ctx, StorageID(storageID), Namespace(ns), nil)
if err != nil {
return nil, fmt.Errorf("failed creating range writer: %w", err)
}
Expand Down Expand Up @@ -110,8 +110,8 @@ func (c *committedManager) WriteRange(ctx context.Context, ns graveler.StorageNa
}, nil
}

func (c *committedManager) WriteMetaRange(ctx context.Context, ns graveler.StorageNamespace, ranges []*graveler.RangeInfo) (*graveler.MetaRangeInfo, error) {
writer := c.metaRangeManager.NewWriter(ctx, ns, nil)
func (c *committedManager) WriteMetaRange(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, ranges []*graveler.RangeInfo) (*graveler.MetaRangeInfo, error) {
writer := c.metaRangeManager.NewWriter(ctx, storageID, ns, nil)
defer func() {
if err := writer.Abort(); err != nil {
logging.FromContext(ctx).WithError(err).Error("Aborting write to meta range")
Expand Down Expand Up @@ -146,8 +146,8 @@ func (c *committedManager) WriteMetaRange(ctx context.Context, ns graveler.Stora
}, nil
}

func (c *committedManager) WriteMetaRangeByIterator(ctx context.Context, ns graveler.StorageNamespace, it graveler.ValueIterator, metadata graveler.Metadata) (*graveler.MetaRangeID, error) {
writer := c.metaRangeManager.NewWriter(ctx, ns, metadata)
func (c *committedManager) WriteMetaRangeByIterator(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, it graveler.ValueIterator, metadata graveler.Metadata) (*graveler.MetaRangeID, error) {
writer := c.metaRangeManager.NewWriter(ctx, storageID, ns, metadata)
defer func() {
if err := writer.Abort(); err != nil {
logging.FromContext(ctx).WithError(err).Error("Aborting write to meta range")
Expand All @@ -170,20 +170,20 @@ func (c *committedManager) WriteMetaRangeByIterator(ctx context.Context, ns grav
return id, nil
}

func (c *committedManager) Diff(ctx context.Context, ns graveler.StorageNamespace, left, right graveler.MetaRangeID) (graveler.DiffIterator, error) {
leftIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, left)
func (c *committedManager) Diff(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, left, right graveler.MetaRangeID) (graveler.DiffIterator, error) {
leftIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, left)
if err != nil {
return nil, err
}
rightIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, right)
rightIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, right)
if err != nil {
return nil, err
}
return NewDiffValueIterator(ctx, leftIt, rightIt), nil
}

func (c *committedManager) Import(ctx context.Context, ns graveler.StorageNamespace, destination, source graveler.MetaRangeID, prefixes []graveler.Prefix, _ ...graveler.SetOptionsFunc) (graveler.MetaRangeID, error) {
destIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, destination)
func (c *committedManager) Import(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, destination, source graveler.MetaRangeID, prefixes []graveler.Prefix, _ ...graveler.SetOptionsFunc) (graveler.MetaRangeID, error) {
destIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, destination)
if err != nil {
return "", fmt.Errorf("get destination iterator: %w", err)
}
Expand Down Expand Up @@ -228,6 +228,7 @@ type mergeContext struct {
srcIt Iterator
baseIt Iterator
strategy graveler.MergeStrategy
storageID graveler.StorageID
ns graveler.StorageNamespace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this also be renamed from ns to namespace, to align terminology?

destinationID graveler.MetaRangeID
sourceID graveler.MetaRangeID
Expand All @@ -238,7 +239,7 @@ func (c *committedManager) merge(ctx context.Context, mctx mergeContext) (gravel
var err error = nil
baseIt := mctx.baseIt
if baseIt == nil {
baseIt, err = c.metaRangeManager.NewMetaRangeIterator(ctx, mctx.ns, mctx.baseID)
baseIt, err = c.metaRangeManager.NewMetaRangeIterator(ctx, mctx.storageID, mctx.ns, mctx.baseID)
if err != nil {
return "", fmt.Errorf("get base iterator: %w", err)
}
Expand All @@ -247,7 +248,7 @@ func (c *committedManager) merge(ctx context.Context, mctx mergeContext) (gravel

destIt := mctx.destIt
if destIt == nil {
destIt, err = c.metaRangeManager.NewMetaRangeIterator(ctx, mctx.ns, mctx.destinationID)
destIt, err = c.metaRangeManager.NewMetaRangeIterator(ctx, mctx.storageID, mctx.ns, mctx.destinationID)
if err != nil {
return "", fmt.Errorf("get destination iterator: %w", err)
}
Expand All @@ -256,14 +257,14 @@ func (c *committedManager) merge(ctx context.Context, mctx mergeContext) (gravel

srcIt := mctx.srcIt
if srcIt == nil {
srcIt, err = c.metaRangeManager.NewMetaRangeIterator(ctx, mctx.ns, mctx.sourceID)
srcIt, err = c.metaRangeManager.NewMetaRangeIterator(ctx, mctx.storageID, mctx.ns, mctx.sourceID)
if err != nil {
return "", fmt.Errorf("get source iterator: %w", err)
}
defer srcIt.Close()
}

mwWriter := c.metaRangeManager.NewWriter(ctx, mctx.ns, nil)
mwWriter := c.metaRangeManager.NewWriter(ctx, mctx.storageID, mctx.ns, nil)
defer func() {
err = mwWriter.Abort()
if err != nil {
Expand All @@ -285,15 +286,15 @@ func (c *committedManager) merge(ctx context.Context, mctx mergeContext) (gravel
return *newID, err
}

func (c *committedManager) Commit(ctx context.Context, ns graveler.StorageNamespace, baseMetaRangeID graveler.MetaRangeID, changes graveler.ValueIterator, allowEmpty bool, _ ...graveler.SetOptionsFunc) (graveler.MetaRangeID, graveler.DiffSummary, error) {
mwWriter := c.metaRangeManager.NewWriter(ctx, ns, nil)
func (c *committedManager) Commit(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, baseMetaRangeID graveler.MetaRangeID, changes graveler.ValueIterator, allowEmpty bool, _ ...graveler.SetOptionsFunc) (graveler.MetaRangeID, graveler.DiffSummary, error) {
mwWriter := c.metaRangeManager.NewWriter(ctx, storageID, ns, nil)
defer func() {
err := mwWriter.Abort()
if err != nil {
logging.FromContext(ctx).WithError(err).Error("Abort failed after Commit")
}
}()
metaRangeIterator, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, baseMetaRangeID)
metaRangeIterator, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, baseMetaRangeID)
summary := graveler.DiffSummary{
Count: map[graveler.DiffType]int{},
}
Expand All @@ -315,12 +316,12 @@ func (c *committedManager) Commit(ctx context.Context, ns graveler.StorageNamesp
return *newID, summary, err
}

func (c *committedManager) Compare(ctx context.Context, ns graveler.StorageNamespace, destination, source, base graveler.MetaRangeID) (graveler.DiffIterator, error) {
diffIt, err := c.Diff(ctx, ns, destination, source)
func (c *committedManager) Compare(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, destination, source, base graveler.MetaRangeID) (graveler.DiffIterator, error) {
diffIt, err := c.Diff(ctx, storageID, ns, destination, source)
if err != nil {
return nil, fmt.Errorf("diff: %w", err)
}
baseIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, ns, base)
baseIt, err := c.metaRangeManager.NewMetaRangeIterator(ctx, storageID, ns, base)
if err != nil {
diffIt.Close()
return nil, fmt.Errorf("get base iterator: %w", err)
Expand All @@ -329,20 +330,20 @@ func (c *committedManager) Compare(ctx context.Context, ns graveler.StorageNames
}

func (c *committedManager) GetMetaRange(ctx context.Context, ns graveler.StorageNamespace, id graveler.MetaRangeID) (graveler.MetaRangeAddress, error) {
uri, err := c.metaRangeManager.GetMetaRangeURI(ctx, ns, id)
uri, err := c.metaRangeManager.GetMetaRangeURI(ctx, id)
return graveler.MetaRangeAddress(uri), err
}

func (c *committedManager) GetRange(ctx context.Context, ns graveler.StorageNamespace, id graveler.RangeID) (graveler.RangeAddress, error) {
uri, err := c.metaRangeManager.GetRangeURI(ctx, ns, id)
uri, err := c.metaRangeManager.GetRangeURI(ctx, id)
return graveler.RangeAddress(uri), err
}

func (c *committedManager) GetRangeIDByKey(ctx context.Context, ns graveler.StorageNamespace, id graveler.MetaRangeID, key graveler.Key) (graveler.RangeID, error) {
func (c *committedManager) GetRangeIDByKey(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, id graveler.MetaRangeID, key graveler.Key) (graveler.RangeID, error) {
if id == "" {
return "", graveler.ErrNotFound
}
r, err := c.metaRangeManager.GetRangeByKey(ctx, ns, id, key)
r, err := c.metaRangeManager.GetRangeByKey(ctx, storageID, ns, id, key)
if err != nil {
return "", fmt.Errorf("get range for key: %w", err)
}
Expand Down
11 changes: 6 additions & 5 deletions pkg/graveler/committed/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestManager_WriteRange(t *testing.T) {
rangeWriter := mock.NewMockRangeWriter(ctrl)

rangeWriter.EXPECT().Abort().Return(nil)
rangeManager.EXPECT().GetWriter(context.Background(), committed.Namespace(ns), nil).Return(rangeWriter, nil)
rangeManager.EXPECT().GetWriter(context.Background(), committed.StorageID(""), committed.Namespace(ns), nil).Return(rangeWriter, nil)

sut := committed.NewCommittedManager(metarangeManager, rangeManager, params)

Expand All @@ -69,7 +69,7 @@ func TestManager_WriteRange(t *testing.T) {
rangeWriter.EXPECT().SetMetadata(committed.MetadataTypeKey, committed.MetadataRangesType)

it := testutils.NewFakeValueIterator(tt.records)
rangeInfo, err := sut.WriteRange(context.Background(), ns, it)
rangeInfo, err := sut.WriteRange(context.Background(), "", ns, it)
require.NoError(t, err)
require.Equal(t, &graveler.RangeInfo{
ID: graveler.RangeID(writeResult.RangeID),
Expand All @@ -84,7 +84,8 @@ func TestManager_WriteRange(t *testing.T) {

func TestManager_WriteMetaRange(t *testing.T) {
const (
ns = "some-ns"
storageID = ""
ns = "some-ns"
)

expectedMetarangeID := graveler.MetaRangeID("some-id")
Expand Down Expand Up @@ -117,7 +118,7 @@ func TestManager_WriteMetaRange(t *testing.T) {
metarangeWriter := mock.NewMockMetaRangeWriter(ctrl)

minKey := ""
metarangeManager.EXPECT().NewWriter(context.Background(), graveler.StorageNamespace(ns), nil).Return(metarangeWriter)
metarangeManager.EXPECT().NewWriter(context.Background(), graveler.StorageID(storageID), graveler.StorageNamespace(ns), nil).Return(metarangeWriter)
metarangeWriter.EXPECT().WriteRange(gomock.Any()).Return(nil).
DoAndReturn(func(info committed.Range) error {
if string(info.MinKey) < minKey {
Expand All @@ -130,7 +131,7 @@ func TestManager_WriteMetaRange(t *testing.T) {
metarangeWriter.EXPECT().Abort().Return(nil)
sut := committed.NewCommittedManager(metarangeManager, rangeManager, params)

actualMetarangeID, err := sut.WriteMetaRange(context.Background(), ns, tt.records)
actualMetarangeID, err := sut.WriteMetaRange(context.Background(), storageID, ns, tt.records)
require.NoError(t, err)
require.Equal(t, &graveler.MetaRangeInfo{ID: expectedMetarangeID}, actualMetarangeID)
})
Expand Down
8 changes: 4 additions & 4 deletions pkg/graveler/committed/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1715,13 +1715,13 @@ func runMergeTests(tests testCases, t *testing.T) {
}
}
metaRangeManager := mock.NewMockMetaRangeManager(ctrl)
metaRangeManager.EXPECT().NewWriter(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(writer)
metaRangeManager.EXPECT().NewWriter(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(writer)
sourceMetaRangeID := tst.sourceRange.GetMetaRangeID()
destMetaRangeID := tst.destRange.GetMetaRangeID()
baseMetaRangeID := tst.baseRange.GetMetaRangeID()
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), baseMetaRangeID).AnyTimes().Return(createIter(tst.baseRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), sourceMetaRangeID).AnyTimes().Return(createIter(tst.sourceRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), destMetaRangeID).AnyTimes().Return(createIter(tst.destRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), gomock.Any(), baseMetaRangeID).AnyTimes().Return(createIter(tst.baseRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), gomock.Any(), sourceMetaRangeID).AnyTimes().Return(createIter(tst.sourceRange), nil)
metaRangeManager.EXPECT().NewMetaRangeIterator(gomock.Any(), gomock.Any(), gomock.Any(), destMetaRangeID).AnyTimes().Return(createIter(tst.destRange), nil)

rangeManager := mock.NewMockRangeManager(ctrl)

Expand Down
Loading
Loading