Skip to content
Merged
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
6 changes: 3 additions & 3 deletions pkg/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ type EntryConflictResolver interface {
// ResolveConflict resolves conflicts between two DBEntry values.
// It returns the resolved value, or nil if the conflict cannot be resolved automatically.
// Assuming the source and dest have the same key (path).
ResolveConflict(ctx context.Context, sCtx graveler.StorageContext, strategy graveler.MergeStrategy, srcValue, destValue *DBEntry) (*DBEntry, error)
ResolveConflict(ctx context.Context, sCtx graveler.StorageContext, srcValue, destValue *DBEntry) (*DBEntry, error)
}

const (
Expand Down Expand Up @@ -3322,7 +3322,7 @@ type ConflictResolverWrapper struct {
ConflictResolver EntryConflictResolver
}

func (cr *ConflictResolverWrapper) ResolveConflict(ctx context.Context, sCtx graveler.StorageContext, strategy graveler.MergeStrategy, srcValue, destValue *graveler.ValueRecord) (*graveler.ValueRecord, error) {
func (cr *ConflictResolverWrapper) ResolveConflict(ctx context.Context, sCtx graveler.StorageContext, _ graveler.MergeStrategy, srcValue, destValue *graveler.ValueRecord) (*graveler.ValueRecord, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

qq, if we're removing the strategy from the interface, why do you keep it in the ConflictResolverWrapper implementation? wouldn't that break its interface compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The strategy is removed from the catalog.EntryConflictResolver interface,
While ConflictResolverWrapper implements the graveler.ConflictResolver interface.

The only struct that implements catalog.EntryConflictResolver is in the Enterprise.

if !cr.ConflictResolver.FilterByPath(string(srcValue.Key)) {
// Not a conflict the catalog should resolve
return nil, nil
Expand All @@ -3339,7 +3339,7 @@ func (cr *ConflictResolverWrapper) ResolveConflict(ctx context.Context, sCtx gra
}

// Resolve conflict
resolvedDBEntry, err := cr.ConflictResolver.ResolveConflict(ctx, sCtx, strategy, srcDBEntry, destDBEntry)
resolvedDBEntry, err := cr.ConflictResolver.ResolveConflict(ctx, sCtx, srcDBEntry, destDBEntry)
if err != nil {
return nil, err
}
Expand Down
Loading