Fix container nodes cache #1248

Merged
fyrchik merged 3 commits from fyrchik/frostfs-node:container-nodes-cache into master 2024-07-16 12:21:39 +00:00

3 commits

Author SHA1 Message Date
2d23b3718e [#1248] placement: Decouple ContainerNodes() cache from the placement builder.
All checks were successful
DCO action / DCO (pull_request) Successful in 3m42s
Vulncheck / Vulncheck (pull_request) Successful in 3m29s
Build / Build Components (1.21) (pull_request) Successful in 4m37s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m21s
Build / Build Components (1.22) (pull_request) Successful in 6m27s
Tests and linters / Lint (pull_request) Successful in 7m28s
Tests and linters / Staticcheck (pull_request) Successful in 8m12s
Tests and linters / gopls check (pull_request) Successful in 9m7s
Tests and linters / Tests (1.21) (pull_request) Successful in 13m26s
Tests and linters / Tests with -race (pull_request) Successful in 16m51s
Tests and linters / Tests (1.22) (pull_request) Successful in 17m19s
Also, write tests.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-15 15:35:07 +03:00
888d4ea060 [#1248] placement: Use epoch to track netmap versions
Previously we used pointer, this could have worked,
because most of the time, the netmap is cached.
This didn't work, however, because `lastNm` field was always nil.

Rework the mechanism completely:
1. Use epoch to track netmap versions, as it it simpler and
   is unrelated to the TTL of an underlying cache.
2. Fix a bug where the epoch could change while mutex was unlocked.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-15 13:49:00 +03:00
a875f7b172 [#1248] placement: Use cid.ID as key in the cache
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-15 13:49:00 +03:00