[#9999] shard: Resolve linters
Some checks failed
Tests and linters / Lint (pull_request) Failing after 9s
DCO action / DCO (pull_request) Successful in 1m25s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m59s
Build / Build Components (1.21) (pull_request) Successful in 4m38s
Vulncheck / Vulncheck (pull_request) Successful in 4m50s
Build / Build Components (1.22) (pull_request) Successful in 4m46s
Tests and linters / gopls check (pull_request) Failing after 6m3s
Tests and linters / Staticcheck (pull_request) Successful in 6m8s
Tests and linters / Tests (1.22) (pull_request) Failing after 8m48s
Tests and linters / Tests (1.21) (pull_request) Failing after 8m58s
Tests and linters / Tests with -race (pull_request) Failing after 8m49s
Some checks failed
Tests and linters / Lint (pull_request) Failing after 9s
DCO action / DCO (pull_request) Successful in 1m25s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m59s
Build / Build Components (1.21) (pull_request) Successful in 4m38s
Vulncheck / Vulncheck (pull_request) Successful in 4m50s
Build / Build Components (1.22) (pull_request) Successful in 4m46s
Tests and linters / gopls check (pull_request) Failing after 6m3s
Tests and linters / Staticcheck (pull_request) Successful in 6m8s
Tests and linters / Tests (1.22) (pull_request) Failing after 8m48s
Tests and linters / Tests (1.21) (pull_request) Failing after 8m58s
Tests and linters / Tests with -race (pull_request) Failing after 8m49s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e3c322f6a4
commit
4722766721
6 changed files with 10 additions and 10 deletions
|
@ -277,7 +277,7 @@ func (e *StorageEngine) processExpiredLocks(ctx context.Context, epoch uint64, l
|
||||||
|
|
||||||
func (e *StorageEngine) processDeletedLocks(ctx context.Context, lockers []oid.Address) {
|
func (e *StorageEngine) processDeletedLocks(ctx context.Context, lockers []oid.Address) {
|
||||||
e.iterateOverUnsortedShards(func(sh hashedShard) (stop bool) {
|
e.iterateOverUnsortedShards(func(sh hashedShard) (stop bool) {
|
||||||
sh.HandleDeletedLocks(lockers)
|
sh.HandleDeletedLocks(ctx, lockers)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
|
|
@ -410,7 +410,7 @@ func (s *Shard) Reload(ctx context.Context, opts ...Option) error {
|
||||||
// config after the node was updated.
|
// config after the node was updated.
|
||||||
err = s.refillMetabase(ctx)
|
err = s.refillMetabase(ctx)
|
||||||
} else {
|
} else {
|
||||||
err = s.metaBase.Init()
|
err = s.metaBase.Init2(ctx)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.log.Error(logs.ShardCantInitializeMetabaseMoveToADegradedreadonlyMode, zap.Error(err))
|
s.log.Error(logs.ShardCantInitializeMetabaseMoveToADegradedreadonlyMode, zap.Error(err))
|
||||||
|
|
|
@ -730,12 +730,12 @@ func (s *Shard) inhumeUnlockedIfExpired(ctx context.Context, epoch uint64, unloc
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleDeletedLocks unlocks all objects which were locked by lockers.
|
// HandleDeletedLocks unlocks all objects which were locked by lockers.
|
||||||
func (s *Shard) HandleDeletedLocks(lockers []oid.Address) {
|
func (s *Shard) HandleDeletedLocks(ctx context.Context, lockers []oid.Address) {
|
||||||
if s.GetMode().NoMetabase() {
|
if s.GetMode().NoMetabase() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := s.metaBase.FreeLockedBy(context.TODO(), lockers)
|
_, err := s.metaBase.FreeLockedBy(ctx, lockers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.log.Warn(logs.ShardFailureToUnlockObjects,
|
s.log.Warn(logs.ShardFailureToUnlockObjects,
|
||||||
zap.String("error", err.Error()),
|
zap.String("error", err.Error()),
|
||||||
|
|
|
@ -61,8 +61,8 @@ func Test_ObjectNotFoundIfNotDeletedFromMetabase(t *testing.T) {
|
||||||
meta.WithEpochState(epochState{}),
|
meta.WithEpochState(epochState{}),
|
||||||
),
|
),
|
||||||
WithPiloramaOptions(pilorama.WithPath(filepath.Join(rootPath, "pilorama"))),
|
WithPiloramaOptions(pilorama.WithPath(filepath.Join(rootPath, "pilorama"))),
|
||||||
WithDeletedLockCallback(func(_ context.Context, addresses []oid.Address) {
|
WithDeletedLockCallback(func(ctx context.Context, addresses []oid.Address) {
|
||||||
sh.HandleDeletedLocks(addresses)
|
sh.HandleDeletedLocks(ctx, addresses)
|
||||||
}),
|
}),
|
||||||
WithExpiredLocksCallback(func(ctx context.Context, epoch uint64, a []oid.Address) {
|
WithExpiredLocksCallback(func(ctx context.Context, epoch uint64, a []oid.Address) {
|
||||||
sh.HandleExpiredLocks(ctx, epoch, a)
|
sh.HandleExpiredLocks(ctx, epoch, a)
|
||||||
|
|
|
@ -53,8 +53,8 @@ func TestShard_Lock(t *testing.T) {
|
||||||
meta.WithPath(filepath.Join(rootPath, "meta")),
|
meta.WithPath(filepath.Join(rootPath, "meta")),
|
||||||
meta.WithEpochState(epochState{}),
|
meta.WithEpochState(epochState{}),
|
||||||
),
|
),
|
||||||
WithDeletedLockCallback(func(_ context.Context, addresses []oid.Address) {
|
WithDeletedLockCallback(func(ctx context.Context, addresses []oid.Address) {
|
||||||
sh.HandleDeletedLocks(addresses)
|
sh.HandleDeletedLocks(ctx, addresses)
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,8 +89,8 @@ func newCustomShard(t testing.TB, enableWriteCache bool, o shardOptions) *Shard
|
||||||
WithPiloramaOptions(pilorama.WithPath(filepath.Join(o.rootPath, "pilorama"))),
|
WithPiloramaOptions(pilorama.WithPath(filepath.Join(o.rootPath, "pilorama"))),
|
||||||
WithWriteCache(enableWriteCache),
|
WithWriteCache(enableWriteCache),
|
||||||
WithWriteCacheOptions(o.wcOpts),
|
WithWriteCacheOptions(o.wcOpts),
|
||||||
WithDeletedLockCallback(func(_ context.Context, addresses []oid.Address) {
|
WithDeletedLockCallback(func(ctx context.Context, addresses []oid.Address) {
|
||||||
sh.HandleDeletedLocks(addresses)
|
sh.HandleDeletedLocks(ctx, addresses)
|
||||||
}),
|
}),
|
||||||
WithExpiredLocksCallback(func(ctx context.Context, epoch uint64, a []oid.Address) {
|
WithExpiredLocksCallback(func(ctx context.Context, epoch uint64, a []oid.Address) {
|
||||||
sh.HandleExpiredLocks(ctx, epoch, a)
|
sh.HandleExpiredLocks(ctx, epoch, a)
|
||||||
|
|
Loading…
Reference in a new issue