Commit Graph

2718 Commits (809e97626b367d4ae054cf6e9846fa617812b183)

Author SHA1 Message Date
Dmitrii Stepanov 809e97626b [#602] blobovnicza: Fix size counter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-17 19:17:35 +00:00
Dmitrii Stepanov 2e49d7ea7e [#602] blobovnicza: Init before using
Fix blobovnicza size: after restart size metric resets.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-17 19:17:35 +00:00
Evgenii Stratonikov f7042c5a6f [#609] Replace zaptest.NewLogger() with zap.L()
Semantic patch:
```
@@
@@
-import "go.uber.org/zap/zaptest"
+import "go.uber.org/zap"

-zaptest.NewLogger(t)
+zap.L()
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 16:51:10 +00:00
Evgenii Stratonikov 127c676786 [#607] *: Use keys.PublicKeys.Copy() where possible
Semantic patch:
```
@@
var dst identifier
var src identifier
var keys identifier
@@
 import keys "github.com/nspcc-dev/neo-go/pkg/crypto/keys"

-dst := make(keys.PublicKeys, len(src))
-copy(dst, src)
+dst := src.Copy()
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 16:50:02 +00:00
Evgenii Stratonikov e604a3d749 [#607] *: Use zap.Stringer() where possible
Semantic patch:
```
@@
var f expression
var t expression
var a expression
@@
 f(
    ...,
-    zap.String(t, a.String()),
+    zap.Stringer(t, a),
    ...,
)
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 16:50:02 +00:00
Evgenii Stratonikov a8de37c8a2 [#607] *: Remove redundant if on error returns
Semantic patch:
```
@@
@@
-if err != nil { return err }
-return nil
+return err
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 16:50:02 +00:00
Evgenii Stratonikov 5a51b78946 [#620] object: Send status response for server-side streams
Previously status responses were wrapped in the gRPC error and thus
couldn't be correctly handled on client.

Introduced in c2617baf63, thanks @ale64bit for having found.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 12:52:38 +00:00
Anton Nikiforov 6407bb5bd1 [#619] node: Fix object put when copies numbers contains only zeros
DCO action / DCO (pull_request) Successful in 3m59s Details
Build / Build Components (1.21) (pull_request) Successful in 4m53s Details
Vulncheck / Vulncheck (pull_request) Successful in 4m43s Details
Build / Build Components (1.20) (pull_request) Successful in 5m57s Details
Tests and linters / Staticcheck (pull_request) Successful in 8m18s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 8m33s Details
Tests and linters / Tests with -race (pull_request) Successful in 8m41s Details
Tests and linters / Lint (pull_request) Successful in 8m58s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 8m53s Details
In this case object should placement according to replicas.

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2023-08-17 11:31:34 +03:00
Evgenii Stratonikov 5335e7089e [#615] pilorama: Speedup TestForest_ApplyRandom()
Some of our pilorama tests fail on CI.
The reasons are not obvious, but one possible improvement
is using `WithNoSync` option for these. It should have much effect,
because we are writing on the tmpfs, but doesn't hurt anyway.

If I replace `t.TempDir()` with a local directory, test execution time
goes down from 5s (sync) to 0.4s (nosync), which is the same time as
with `t.TempDir()`. Maybe we have some strange CI configuration.

```
panic: test timed out after 10m0s
running tests:
	TestForest_ApplyRandom (8m22s)
	TestForest_ApplyRandom/bbolt (8m21s)
...
goroutine 170 [syscall]:
syscall.Syscall(0xc000100000?, 0xc00047b758?, 0x6aff9a?, 0xc00041c1b0?)
	/opt/hostedtoolcache/go/1.20.7/x64/src/syscall/syscall_linux.go:69 +0x27
syscall.Fdatasync(0x9e35c0?)
	/opt/hostedtoolcache/go/1.20.7/x64/src/syscall/zsyscall_linux_amd64.go:418 +0x2a
go.etcd.io/bbolt.fdatasync(0xc000189000?)
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-16 19:09:08 +00:00
Dmitrii Stepanov 2efe9cc1be [#585] writecache: Fix DB counter
DCO action / DCO (pull_request) Successful in 2m14s Details
Vulncheck / Vulncheck (pull_request) Successful in 2m44s Details
Build / Build Components (1.21) (pull_request) Successful in 2m54s Details
Build / Build Components (1.20) (pull_request) Successful in 3m5s Details
Tests and linters / Staticcheck (pull_request) Successful in 3m43s Details
Tests and linters / Lint (pull_request) Successful in 5m12s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 7m44s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 21m5s Details
Tests and linters / Tests with -race (pull_request) Failing after 26m26s Details
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-16 14:47:44 +03:00
Dmitrii Stepanov 58c8722c81 [#585] fstree: Add optional file counter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-16 14:47:44 +03:00
Dmitrii Stepanov baad49990c [#585] fstree: Return logical error if object deleted
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-16 14:47:44 +03:00
Dmitrii Stepanov 0c52186572 [#585] fstree: Remove unused method
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-16 14:47:44 +03:00
Dmitrii Stepanov eec97d177e [#585] writecache: Count items periodically
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-16 14:47:44 +03:00
Evgenii Stratonikov d15199c5d8 [#596] engine: Consider context errors as logical
Vulncheck / Vulncheck (pull_request) Successful in 2m59s Details
DCO action / DCO (pull_request) Successful in 2m54s Details
Build / Build Components (1.20) (pull_request) Successful in 4m2s Details
Build / Build Components (1.21) (pull_request) Successful in 4m51s Details
Tests and linters / Staticcheck (pull_request) Successful in 14m8s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 14m56s Details
Tests and linters / Lint (pull_request) Successful in 15m27s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 15m36s Details
Tests and linters / Tests with -race (pull_request) Failing after 16m18s Details
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-16 10:39:41 +03:00
Alejandro Lopez 88b6755c5e [#598] Fix use-after-close bug in badger writecache
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-15 07:04:06 +00:00
Alejandro Lopez ae8be495c8 [#xx] Avoid manual management of files in tests
Vulncheck / Vulncheck (pull_request) Successful in 2m36s Details
Build / Build Components (1.21) (pull_request) Successful in 3m33s Details
DCO action / DCO (pull_request) Successful in 3m33s Details
Tests and linters / Staticcheck (pull_request) Successful in 4m15s Details
Tests and linters / Lint (pull_request) Successful in 5m31s Details
Build / Build Components (1.20) (pull_request) Successful in 7m2s Details
Tests and linters / Tests with -race (pull_request) Failing after 8m51s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 9m55s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 10m6s Details
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-14 14:01:39 +03:00
Alejandro Lopez 376f03a445 [#598] Hold mode mutex when setting mode
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-14 07:12:27 +00:00
Alexander Chuprov 21800e9fcc [#162] core: Move literals to constants
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2023-08-11 15:48:42 +03:00
Evgenii Stratonikov b44a8dd46c [#597] *: Fix linter warnings
Vulncheck / Vulncheck (pull_request) Successful in 6m26s Details
Tests and linters / Staticcheck (pull_request) Successful in 7m20s Details
Build / Build Components (1.21) (pull_request) Successful in 8m31s Details
Build / Build Components (1.20) (pull_request) Successful in 8m43s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 15m48s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 16m2s Details
Tests and linters / Tests with -race (pull_request) Failing after 16m28s Details
Tests and linters / Lint (pull_request) Successful in 19m8s Details
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-11 09:55:51 +03:00
Evgenii Stratonikov e084c47bd6 [#248] innerring: Remove audit from tests
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 16:38:43 +00:00
Evgenii Stratonikov 779da6ec35 [#248] morph: Remove audit contract name
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 16:38:43 +00:00
Evgenii Stratonikov 55ce4dc075 [#248] morph: Remove obsolete network parameters
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 16:38:43 +00:00
Anton Nikiforov 4ad0ebb32f [#565] Add metrics for current GRPC endpoint status
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2023-08-10 16:37:49 +00:00
Evgenii Stratonikov c3e23a1448 [#578] gendoc: Allow to override flags
The command is used in multiple places across the whole FrostFS
ecosystem. While we want to have uniform interfaces everywhere,
sometimes we can't: already defined global flags can be harder to change
because of our obligations to the users. Cobra framework doesn't allow
conflicting flags (we can have global ones), so allow to override them.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 11:10:11 +00:00
Evgenii Stratonikov 6bcba27757 [#578] gendoc: Remove flag shorthands
Make it harder to encounter conflicts in already existing commands.
Because the command is executed once, I don't think the usability is
worse.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 11:10:11 +00:00
Evgenii Stratonikov dca31e8888 [#578] gendoc: Add date to man pages
```
HISTORY
       8-Aug-2023 Auto generated by spf13/cobra
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 11:10:11 +00:00
Evgenii Stratonikov b02a1a34c1 [#578] gendoc: Allow to customize man pages
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 11:10:11 +00:00
Evgenii Stratonikov 082370583f [#578] gendoc: Replace NSPCC with FrostFS
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-10 11:10:11 +00:00
Alejandro Lopez 8f994163ee [#586] Fix writecache benchmarks and refactor hacky NeedsCompression
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-10 08:05:18 +00:00
Alejandro Lopez 023b90342c [#584] Disable compression in badger writecache
Build / Build Components (1.20) (pull_request) Failing after 3s Details
Build / Build Components (1.21) (pull_request) Failing after 2s Details
Tests and linters / Lint (pull_request) Failing after 4s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 3s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 3s Details
Tests and linters / Tests with -race (pull_request) Failing after 3s Details
Tests and linters / Staticcheck (pull_request) Failing after 3s Details
Vulncheck / Vulncheck (pull_request) Failing after 3s Details
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-10 10:14:06 +03:00
Evgenii Stratonikov d641cba2fc [#587] Do not use math/rand.Read
Build / Build Components (1.20) (pull_request) Failing after 3s Details
Build / Build Components (1.21) (pull_request) Failing after 3s Details
Tests and linters / Lint (pull_request) Failing after 3s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 3s Details
Tests and linters / Tests (1.21) (pull_request) Failing after 3s Details
Tests and linters / Tests with -race (pull_request) Failing after 5s Details
Tests and linters / Staticcheck (pull_request) Failing after 8s Details
Vulncheck / Vulncheck (pull_request) Failing after 2s Details
Fix staticcheck warnings after go1.20 update.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-09 16:02:44 +03:00
Alejandro Lopez 5b7e4a51b7 [#481] Update frostfs-sdk-go and error pointer receivers
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-09 10:26:53 +00:00
Alejandro Lopez ae322e9f73 [#576] Set SyncWrites for badger writecache by default
Build / Build Components (1.19) (pull_request) Failing after 3s Details
Build / Build Components (1.20) (pull_request) Failing after 2s Details
Tests and linters / Tests (1.19) (pull_request) Failing after 3s Details
Tests and linters / Tests with -race (pull_request) Failing after 3s Details
Tests and linters / Lint (pull_request) Failing after 12s Details
Tests and linters / Staticcheck (pull_request) Failing after 3s Details
Vulncheck / Vulncheck (pull_request) Successful in 5m46s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 11m37s Details
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-09 11:28:26 +03:00
Anton Nikiforov 8d589314b5 [#560] node: Fix `Put` in multi REP with intersecting sets of nodes
Once the node was processed it skipped, at the step of forming
result in case when all nodes skipped, because processed for
previous REP, service mark the whole request as incomplete.

Example of policies which are unblocked:
- REP 1 REP 1 CBF 1
- REP 4 IN X REP 4 IN Y
  CBF 4
  SELECT 2 FROM FX AS X SELECT 2 FROM FY AS Y
  FILTER Country EQ Russia OR Country EQ Sweden OR Country EQ Finland AS FY
  FILTER Price GE 0 AS FX

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2023-08-08 10:22:53 +00:00
Alejandro Lopez 7da4306e38 [#575] writecache: Fix log level for badger writecache
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-08 08:16:36 +00:00
Dmitrii Stepanov 0e697266c3 [#563] writecache: Fix metrics and bolt delete
Estimate cache size after delete objects to update metric.
Update counters on small object deletion.
Do not count bbolt DB file as FSTree object.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-07 12:53:28 +00:00
Alejandro Lopez 1a0cb0f34a [#421] Try using badger for the write-cache
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-07 08:16:57 +00:00
Alejandro Lopez 65c72f3e0b [#559] Remove manual path handling in fstree tests
Build / Build Components (1.19) (pull_request) Successful in 2m8s Details
Build / Build Components (1.20) (pull_request) Successful in 1m54s Details
Tests and linters / Lint (pull_request) Successful in 2m48s Details
Tests and linters / Tests (1.19) (pull_request) Successful in 1m53s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 2m4s Details
Tests and linters / Tests with -race (pull_request) Successful in 5m21s Details
Tests and linters / Staticcheck (pull_request) Successful in 2m16s Details
Vulncheck / Vulncheck (pull_request) Failing after 16m3s Details
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-03 10:03:41 +03:00
Evgenii Stratonikov 1e8b4b8a17 [#557] services: Regenerate stable marshalers
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-02 13:37:40 +00:00
Airat Arifullin b3695411d9 [#553] eacl: Fix bug with casting to ObjectAccessDenied error
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
2023-08-02 07:22:48 +00:00
Evgenii Stratonikov 35dc64bd7b [#547] metabase: Fix datarace in tests
Quite an old one bf9e938a3b.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-31 15:35:15 +00:00
Evgenii Stratonikov 05ac9e3637 [#547] objectsvc: Work with `traversal` struct from a single thread
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-31 15:35:15 +00:00
Evgenii Stratonikov 7b0fdf0202 [#533] services: Assume API supports status codes
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-31 15:35:15 +00:00
Evgenii Stratonikov ec8b4fdc48 [#541] writecache/test: Close writecache on exit
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-29 10:57:25 +00:00
Evgenii Stratonikov ad5f527bd3 [#541] writecache/test: Remove initWC()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-29 10:57:25 +00:00
Dmitrii Stepanov ea32913430 [#543] putsvc: Fix PutSingle implementation
Add Lock and Delete handlers to local PutSingle.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-07-28 12:09:41 +00:00
Dmitrii Stepanov 99bb488ebd [#539] getsvc: Write payload direct to out stream
Build / Build Components (1.20) (pull_request) Failing after 1s Details
Build / Build Components (1.19) (pull_request) Failing after 3s Details
Tests and linters / Lint (pull_request) Failing after 2s Details
Tests and linters / Tests (1.19) (pull_request) Failing after 1s Details
Tests and linters / Tests (1.20) (pull_request) Failing after 2s Details
Tests and linters / Tests with -race (pull_request) Failing after 1s Details
Vulncheck / Vulncheck (pull_request) Failing after 2s Details
Tests and linters / Staticcheck (pull_request) Failing after 2s Details
To reduce memory allocations.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-07-27 17:02:08 +03:00
Dmitrii Stepanov 286242cad0 [#539] getsvc: Use buffer to assemble object
To reduce memory consumption.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-07-27 17:02:08 +03:00
Evgenii Stratonikov 5ff82ff04f [#6] services/object: Simplify local/remote targets
ci/woodpecker/pr/pre-commit Pipeline was successful Details
Tests and linters / Tests (1.19) (pull_request) Successful in 14m18s Details
Vulncheck / Vulncheck (pull_request) Failing after 2m23s Details
Tests and linters / Staticcheck (pull_request) Successful in 4m8s Details
Build / Build Components (1.19) (pull_request) Successful in 3m26s Details
Build / Build Components (1.20) (pull_request) Successful in 2m56s Details
Tests and linters / Tests with -race (pull_request) Successful in 21m39s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 22m36s Details
Tests and linters / Lint (pull_request) Successful in 1m39s Details
ci/woodpecker/push/pre-commit Pipeline was successful Details
We do not use the return result from Close() and we always execute both
methods in succession. It makes sense to unite them.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-21 18:39:12 +03:00