storj/satellite/gracefulexit
Ivan Fraixedes 7fb86617fc satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE
Use the 'AS OF SYSTEM TIME' Cockroach DB clause for the Graceful Exit
(a.k.a GE) queries that count the delete the GE queue items of nodes
which have already exited the network.

Split the subquery used for deleting all the transfer queue items of
nodes which has exited when CRDB is used and batch the queries because
CRDB struggles when executing in a single query unlike Postgres.

The new test which has been added to this commit to verify the CRDB
batch logic for deleting all the transfer queue items of the exited
nodes has raised that the Enqueue method has to run in baches when CRDB
is used otherwise CRDB has return the error "driver: bad connection"
when a big a amount of items are passed to be enqueued. This error
didn't happen with the current test implementation it was with an
initial one that it was creating a big amount of exited nodes and
transfer queue items for those nodes.

Change-Id: I6a099cdbc515a240596bc93141fea3182c2e50a9
2021-05-07 13:09:19 -04:00
..
chore_test.go satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE 2021-05-07 13:09:19 -04:00
chore.go satellite/metabase/metaloop: move loop under metabase 2021-04-22 12:58:09 +03:00
common.go satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE 2021-05-07 13:09:19 -04:00
db_test.go satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE 2021-05-07 13:09:19 -04:00
db.go satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE 2021-05-07 13:09:19 -04:00
endpoint_test.go storj: use multipart API 2021-04-26 13:15:09 +00:00
endpoint.go satellite/metabase: move package one level higher 2021-04-21 15:54:22 +03:00
getnodes_test.go satellite/overlay: remove old updateaddress method 2020-04-30 06:41:48 +00:00
gracefulexit_test.go satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE 2021-05-07 13:09:19 -04:00
pathcollector.go satellite/satellitedb: Use CRDB AS OF SYSTEM & batch for GE 2021-05-07 13:09:19 -04:00
pending_test.go satellite/metabase: move package one level higher 2021-04-21 15:54:22 +03:00
pending.go satellite/metabase: move package one level higher 2021-04-21 15:54:22 +03:00
validation.go satellite/gracefulexit: migrate to metabase 2020-12-18 10:57:39 +00:00