Page MenuHomeSoftware Heritage

staging: Deploy swh-scrubber database and checkers
Closed, MigratedEdits Locked

Description

Plan:

  • D7494: Install scrubber (postgres) db
  • Check connection is ok
  • D7500: Update documentation on how to connect to db
  • Prepare git repository for debian package [1]
  • Debian package bootstrap
  • Fix debian build papercuts
    • Fix stuck python3-swh.graph.client build failure [2]
    • Fix python3-swh.scrubber (failing due to ^)
  • T4102#82560: Install schema in swh-scrubber db
  • T4102#82560: Grand read-only access to guest user
  • D7590, D7594: Deploy postgres checker service on a dedicated scrubber node

[1]

# First install the 'has-debian-packaging-branch' flag in repository in
# https://forge.softwareheritage.org/diffusion/edit/254/page/basics/
# Then install git pre-receive hook for ci to trigger the debian package build out of a git tag
root@tate:/srv/phabricator/hooks# phabricator-setup-hook /srv/phabricator/repos/254/ post-receive-swh-modules
Hook post-receive-swh-modules successfully installed on /srv/phabricator/repos/254/:

[2] https://jenkins.softwareheritage.org/job/debian/job/packages/job/DGRPH/job/gbp-buildpackage/ back to green!

Event Timeline

ardumont triaged this task as Normal priority.Mar 28 2022, 1:51 PM
ardumont created this task.

swh-scrubber will be made of the following components:

  1. the scrubber database (it's just a regular postgres database, accessed directly with psycopg2). It should remain under 100GB in the forseeable future.
  2. checkers, which each read one datastore (journal, storage but needs to connect directly to postgres, objstorage) and writes to the scrubber DB. They are all highly parallelizable (journal by spawning many identially processes; others by specifying a hash range to each process)
  3. fixers, which work on the scrubber database and no other datastore. One of them will also clone origins in temporary directories.
  4. reinjecters, which read fixed objects from the scrubber database and write them back to datastores

Let's focus on 1 and 2 for now, because 3 and 4 are WIPs, and running a checkers sweep is going to take longer than the entire dev time so we should start ASAP.

ardumont renamed this task from staging: Deploy swh-scrubber to staging: Deploy swh-scrubber database and checkers.Mar 28 2022, 3:29 PM
ardumont updated the task description. (Show Details)
ardumont updated the task description. (Show Details)
ardumont changed the task status from Open to Work in Progress.Apr 4 2022, 5:56 PM
ardumont moved this task from Backlog to Weekly backlog on the System administration board.
ardumont moved this task from Weekly backlog to in-progress on the System administration board.
ardumont updated the task description. (Show Details)
ardumont updated the task description. (Show Details)
ardumont updated the task description. (Show Details)
ardumont updated the task description. (Show Details)

Db got configured [1] with the following snippet [2]:

[1]

16:34:57 swh-scrubber@db1:5432=> \d
                   List of relations
+--------+------------------+----------+--------------+
| Schema |       Name       |   Type   |    Owner     |
+--------+------------------+----------+--------------+
| public | corrupt_object   | table    | swh-scrubber |
| public | datastore        | table    | swh-scrubber |
| public | datastore_id_seq | sequence | swh-scrubber |
| public | dbmodule         | table    | swh-scrubber |
| public | dbversion        | table    | swh-scrubber |
| public | object_origin    | table    | swh-scrubber |
+--------+------------------+----------+--------------+
(6 rows)
16:34:58 swh-scrubber@db1:5432=> grant select on all tables in schema public to guest;
GRANT
Time: 111.580 ms

[2]

$ setup-db.sh
+ DBPORT=5432
+ DBPASSWORD=<redacted>
+ DBUSER=swh-scrubber
+ DBNAME=swh-scrubber
+ DBHOST=db1.internal.staging.swh.network
+ CONNSTRING=postgresql://swh-scrubber:<redacted>@db1.internal.staging.swh.network:5432/swh-scrubber
+ swh db init-admin --dbname postgresql://swh-scrubber:<redacted>@db1.internal.staging.swh.network:5432/swh-scrubber scrubber
+ swh db init --dbname postgresql://swh-scrubber:<redacted>@db1.internal.staging.swh.network:5432/swh-scrubber scrubber
psql:/home/tony/work/inria/repo/swh/swh-environment/swh-core/swh/core/db/sql/36-dbmodule.sql:12: NOTICE:  relation "dbmodule" already exists, skipping
INFO:swh.core.cli.db:Initializing database version to 1 from the command line option --initial-version
DONE database for scrubber initialized at version 1

source: P1330

ardumont claimed this task.
ardumont moved this task from deployed/landed/monitoring to done on the System administration board.