Commit Graph

5138 Commits

Author SHA1 Message Date
Michał Niewrzał
68605f32ed satellite/metainfo: limit number of batched segments in metainfo loop
New metainfo loop can have memory issues when in one batch we will have object with many segments. This change limits number of batched segments to defined limit. Solution is not perfect as if we will have single object with extreme large segments count it can cross defined limit a lot. We need to prepare safer solution soon.

Change-Id: Iefcf466d5bac76513d4219b1a9d99adc361c54ae
2021-02-26 12:32:43 +01:00
Fadila Khadar
8bbabe57db cmd/uplink: allow deletion of pending objects
Basic command for deleting a pending object by object key.

Change-Id: I47f68acf79cb0568a42a65b6d8195ca309b185a7
2021-02-25 14:23:56 +00:00
Fadila Khadar
e96ed289e5 cmd/uplink: add --pending for listing pending objects
Change-Id: I19c1965117c386f63e7b1c71ba70402d312329f0
2021-02-25 13:50:10 +00:00
Michał Niewrzał
a0cc7e8c5e satellite/metainfo/metabase: use segment.Pieces to check if segment is inline
It looks that we cannot use root piece id as indicator if segment is inline as we have case in SLC satellite that inline segment have root piece id set. Pieces should be better thing to check.

Change-Id: I2377ff88861390342273f5e71871373eaf462615
2021-02-24 22:14:18 +01:00
Michał Niewrzał
846bb895e0 satellite/metainfo: loop cleanups
Change-Id: I89b4f519ce18cb0ce34a61a4cbe1675d93741637
2021-02-23 17:48:36 +01:00
Michał Niewrzał
95b78e8011 satellite/metainfo: select segments in batches for metainfo loop
Segments are not read in batches. For each batch of objects
we are reading all segments for those objects.

Change-Id: Idaf19bbe4d4b095065d59399dd326e22c57499a6
2021-02-23 11:38:44 +00:00
Michał Niewrzał
d995fb497f Merge remote-tracking branch 'origin/main' into multipart-upload
Change-Id: I367da03351ab80f7343332420490dde9282aa47a
2021-02-23 12:31:31 +01:00
Egon Elbre
0178ec7771 satellite/satellitedb: clearer testdata version parsing
Change-Id: I93a23625b30472e826b962dab31ff3e1081b1b8f
2021-02-23 10:22:19 +02:00
Egon Elbre
32afbd0d15 satellite/satellitedb: faster test database setup
Pregenerate the database schema we should use for most tests.
Currently, Cockroach is slow with regards to migration and it's
better if it happens in as few transactions as possible.

This reduces test time from ~21min to ~15min.

Change-Id: Ife8117053e6b9ecf3c93fe63677edf15d4d7c254
2021-02-22 21:13:00 +02:00
Egon Elbre
a34da8531b ci: bump test timeout
Currently testing with coverage exceeds the timeout very easily.

Change-Id: I4e77aa98d28bebe373416ac05ee39b4c70c3fed2
2021-02-22 17:31:21 +02:00
Vitalii Shpital
fce5c95eb2 web/satellite: logic for beta satellites terms confirmation
WHAT:
this logic is used on us2 sign up page to accept additional beta terms.

WHY:
to make US2 users know that their data can be removed.

Change-Id: I43f25bc945a5957bacc6662499830cb2dd6d4079
2021-02-22 14:54:51 +00:00
Egon Elbre
21a6dccd36 ci: set specific line coverage targets
Currently the auto-updating keeps moving the target upwards without
allowing for variations in the pipeline.

Let's try these settings:

* >=70% lines covered, to pass
* <=60% lines covered, to mark as unhealthy
* <=50% lines covered, to mark as unstable

Change-Id: Idc75e682345f6d62af34379362c75d321e564d2c
2021-02-22 15:13:18 +02:00
Egon Elbre
bc68898846 ci: enable coverage for multipart-upload branch
Change-Id: I4797d16bbc90a3fc7fc9627386b63124755f4730
2021-02-22 13:43:32 +02:00
Cameron Ayer
549033f2e6 satellite/satellitedb: don't include DQd and exited nodes in DQStrayNodes
Don't update DQ time of already DQd nodes. Don't DQ nodes who exited.

Change-Id: I4528a9ba9f8e278987165ad337a9b34dadb9788b
2021-02-19 15:12:30 -05:00
Egon Elbre
3c49f0ff73 cmd/satellite: restore-trash, cleanup workers
Use a limiter instead of a custom work queue.

Change-Id: I1506daaaaeb2935f6011ddaeb83a0904abb69c98
2021-02-19 19:08:10 +02:00
Ethan
79ecd80c0a satellite/metabase: Remove subquery on delete objects for CRDB
The subquery for DELETE FROM obects returns a stream_id field for filtering. Unfortunately stream_id is not indexed. This change removed the subquery from the CockroachDB delete bucket query.

Change-Id: If1abe21668c593e6d4bdc3ba8cdbad26c09d234e
2021-02-19 16:51:01 +00:00
Egon Elbre
630718c392 satellite/gracefulexit: fix test DeleteAllFinishedTransferQueueItems
Using random piece num may generate the exact same key or piecenum.
Instead use fixed piecenum and key.

Change-Id: I54b7bc1a6698149bf99608dd46501ea963cec084
2021-02-19 18:15:22 +02:00
Egon Elbre
62a2d05ae6 satellite/accounting: try fix test ResetLimitsFirstDayOfNextMonth
TestProjectUsage_ResetLimitsFirstDayOfNextMonth seems to be flaky.
It doesn't seem to reproduce easily, however it should flush orders from
storagenodes to satellites, that way the orders chore flushing on the
satellite makes sense.

Change-Id: I586d9d8ce10b5f6320e79324f6128b4f8c2cac5f
2021-02-19 17:29:15 +02:00
Egon Elbre
1137620baf satellite/satellitedb: move tests to their domains
Testing interfaces is slightly clearer when it's in the package needing
the database rather than each individual implementation.

Change-Id: I10334c214a205f7e510b939b4359a2214c4e060a
2021-02-19 17:29:15 +02:00
JT Olio
e23f423107 uplink: add api key back to inspect
Change-Id: I9aa46f3910a76a81a399597d7512056b218e55af
2021-02-19 14:46:35 +00:00
Kaloyan Raev
e0f15130a2 satellite/metainfo: ensure list prefix is prepended in satStreamID
When listing pending objects with prefix, the prefix should be prepended
to the EncryptedPath in satStreamID. Otherwise, listing multipart
uploads may display different UploadID than expected.

Change-Id: I27e9f9af9348783e053ad123121b6ddd051739e4
2021-02-19 16:32:55 +02:00
Michał Niewrzał
8b9da01817 satellite/metainfo/metabase: allow committing empty inline segments
We need to keep empty inline segments as we did it with pointerDB because otherwise old uplinks after uploading data won't be able to download such file. To reduce number of empty inline segments on uplink side we need to implement skipping empty last inline segments for multipart upload.

Change-Id: Ice86c805babba1ad17149754cbd6b3f4fd652722
2021-02-19 13:41:34 +00:00
Egon Elbre
4c0ea717eb satellite/metainfo: remove unneeded dependencies from Loop
metainfo.Loop doesn't require buckets nor pointerdb anymore.

Also:
* fix comments
* update full iterator limit to 2500

Change-Id: I6604402868f5c34079197c407f969ac8015e63c5
2021-02-19 15:11:16 +02:00
Egon Elbre
a25e35f0b0 cmd/metainfo-loop-benchmark: add benchmark
Change-Id: I0745cfcf9f8c9d73fd025dcba6ee8a7480273fe2
2021-02-19 10:59:41 +02:00
Egon Elbre
1cb6376daa satellite/metainfo: remove BucketsDB.ListAllBuckets
The ListAllBuckets implementation was buggy, remove it altogether.

Change-Id: Id457ba5f4d793156af3fc2071f74ce1be17ba804
2021-02-19 10:59:41 +02:00
Egon Elbre
8e95e76c35 satellite/metainfo: fix metainfo loop
ListAllBuckets could skip buckets when the total number of buckets
exceeds list limit. Replace listing buckets with looping directly
on the objects table.

Change-Id: I43da2fdf51e83915a7854b782f0e9ec32c373018
2021-02-19 10:27:08 +02:00
Egon Elbre
c860b74a37 satellite/repair/checker: allow for multipart objects
We have multipart objects so we may get multiple inline segments
sequences or no segments at all for objects.

Change-Id: Ie46ee777a2db8f18f7154e3443bb9e07ecb170f7
2021-02-18 20:31:49 +02:00
JT Olio
ac8c70e20d cmd/satellite: restore trash connection close
Change-Id: I96ca0ba653005f519a2d5e5e7eeb9e2c9f894056
2021-02-18 11:25:28 -07:00
Egon Elbre
8093c666a6 satellite/metrics: allow for multipart objects
We have multipart objects so we may get multiple inline segments
sequences or no segments at all for objects.

Change-Id: Ic19150efe2ca2b1c60ddd5d30b1317922221c221
2021-02-18 20:04:41 +02:00
JT Olio
b2ed7edd30 cmd/satellite: restore-trash parallel workers
Change-Id: Ic7466b21c20bda334e7ba4268a494e96b6528ac1
2021-02-18 19:11:19 +02:00
Michał Niewrzał
69151965b9 cmd/satellite: add logic to send RestoreTrash to nodes
Change-Id: I69815fa766a40a7266787e96bf9662854ae56937
2021-02-18 09:19:30 -07:00
JT Olio
3ae3389ddc cmd/satellite: restore-trash command
Change-Id: I80fc932c12147692d49cde277784871ac611fcad
2021-02-18 09:19:22 -07:00
Egon Elbre
adf687aebb satellite/metainfo/metabase: add full iterator
Add FullIterateObjects that iterates over all objects in the metabase.

Change-Id: I4b8dbda32dfce2d7729e9574af79e4f20faed98a
2021-02-18 16:51:35 +02:00
NickolaiYurchenko
50239e66f7 web/storagenode: zksync receipt convertation
Change-Id: I5b7b44c4e81a5a5dadf20db4c8ef852d71a01bd3
2021-02-18 09:30:54 +00:00
NickolaiYurchenko
212baf6145 web/storagenode: balance section markup, current month estimated payout frontend implementation
Change-Id: I8820c842e2773a114423eab8370b5c4dc8f73cdd
2021-02-18 09:52:58 +02:00
Jeff Wendling
3eb321fd33 storagenode/console/consoleapi: fix flaky test
Change-Id: I1af928953a19155e3c2e9f8c63e7162978e7b475
2021-02-17 19:48:55 +00:00
Jeff Wendling
9e7e753faf sn/sndb/payouts: migrate distributed == paid for periods < 2020-12
while satellites have also run this logic, old satellites that
no longer exist cannot and so the node cannot get the updated
data. this locally migrates it so that the calculations for
the undistributed amounts are correct.

there's also some tab/space whitespace and gofmt fixes.

Change-Id: I470879703314fe6541eaba5f21b47849781894f8
2021-02-17 13:07:10 -05:00
Stefan Benten
f969e26827
Jenkinsfile, Makefile: bump to go v1.16 (#4041) 2021-02-17 16:54:04 +01:00
Qweder93
dcf7b884ca storagenode/payouts: estimated payouts calculations fixed
Change-Id: I9d5d180aea1606350e0d9214fbf352bf9f76c184
2021-02-17 12:58:41 +00:00
Michał Niewrzał
dd9ad09301 satellite/metainfo: return RS value with DownloadSegment response
Until now we where using single RS per object but it turns out that we
need to be able to support RS per segment. We need to give uplink such information while downloading.

As an addition we are using RedundancySchemePerSegment flag for GetObject request to detect if
we should try to get RS from segment for this request response.

Change-Id: I209dad324496ff59b521b11d2343da61dcdbe7f5
2021-02-17 12:33:48 +00:00
Michał Niewrzał
f1169ad7bd satellite/metainfo: return RS value with DownloadSegment response
Until now we where using single RS per object but it turns out that we
need to be able to support RS per segment. We need to give uplink such information while downloading.

Change-Id: I6565b7c08962b3a1429f6079e7c2023a0a7c8b72
2021-02-17 12:39:53 +01:00
Egon Elbre
61f0fb67a9 satellite/metainfo/metabase: refresh alias cache only once
When there are concurrent refreshes to the cache and the entries are
missing, it could end up causing multiple database calls, even though
only one is needed.

Change-Id: I1ae7a124bbdd1570473cf3a032d375d2f25a8426
2021-02-17 10:00:04 +00:00
Fadila Khadar
259b030b3a satellite/metabase: add tests for BeginObject
adds tests to BeginObjectNextVersion and BeginObjectExactVersion
to check the behavior when an older or a newer committed version
exists.

The current behavior is: everything is committed.

Change-Id: Ia8facbe0dc038a5d214e4e56da3c8e4df2f18900
2021-02-17 09:02:26 +00:00
Michał Niewrzał
12402eb729 Merge remote-tracking branch 'origin/main' into multipart-upload
Change-Id: I38adf8218c1415c7ea1910f8bd6bed13544b0f03
2021-02-17 08:50:38 +01:00
VitaliiShpital
28433327cc web/satellite: remove upload step from create AG flow, close webworker on logout, styling fixes
WHAT:
remove upload info step from create access grant flow
close webworker on logout to always initiate new one on login
small styling fixes

WHY:
better user experience

Change-Id: I41ae0fe859b29889a9cced30f874d4a341e09ad2
2021-02-16 18:46:15 +00:00
Michał Niewrzał
6ebe06cd1b satellite/metainfo: fix for getting real RS values
Change-Id: Ib2cd01b2a68baab9f342dc0ff1ab8e5f12f4557f
2021-02-16 17:26:09 +01:00
Michał Niewrzał
8685c6c9cd private/testplanet: use better method in test
In ec client in uplink we have two methods Put and PutSingleResult. Logic is the same but result for PutSingleResult is combined into single var. We would like to remove unused Put method but to do this it needs to be replaced in test.

Change-Id: Ia65eff3ecc9e68d5b3180b557ea82fa31d3c969c
2021-02-16 13:24:01 +00:00
Fadila Khadar
5dd76522af gracefulexit: use GetSegmentByLocation instead of GetObjectLatestVersion
This enables the transfer of pieces from an on-going multipart upload.
Tests are also modified to take into account pending multipart uploads.

See https://storjlabs.atlassian.net/browse/PG-161

Change-Id: I35d433c44dd6e618667e5e8f9f998ef867b9f1ad
2021-02-16 10:49:36 +00:00
Egon Elbre
f7ad86521e satellite/overlay: fix data race in TestAuditHistoryBasic
Change-Id: I196f10973fe10b10b226ac3a63e62bf4fe9c256b
2021-02-16 12:32:19 +02:00
Michał Niewrzał
79d6294dbe metainfo-migration: fix data race
Change-Id: Idc266509fe7a6a717689f090a1409db09c8e9daa
2021-02-16 09:53:17 +01:00