Skip to content
Snippets Groups Projects

[DNR] add database backend

2 unresolved threads

vault: WIP database backend


Migrated from D208 (view on Phabricator)

Merge request reports

Closed by Phabricator Migration userPhabricator Migration user 7 years ago (Jun 15, 2017 5:39pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 create table dbversion
2 (
3 version int primary key,
4 release timestamptz not null,
5 description text not null
6 );
7 comment on table dbversion is 'Schema update tracking';
8 insert into dbversion (version, release, description)
9 values (1, now(), 'Initial version');
10
11 create domain obj_hash as bytea;
12
13 create type cook_type as enum ('directory', 'revision_gitfast');
14 comment on type cook_type is 'Type of the requested bundle';
  • This is the type of the cooking format, right? As type is ambiguous in this context, maybe this should actually be "cook_format", or maybe even "export_format", or something such?

    (just a nit, of course)

  • It's not exactly the format, it's the format AND the type. for instance: directory, revision_gitfast, revision_hgbundle, snapshot_gitfast...

  • Please register or sign in to reply
  • 17 comment on type cook_status is 'Status of the cooking';
    18
    19 create table vault_bundle (
    20 id bigserial primary key,
    21
    22 type cook_type not null, -- requested cooking type
    23 object_id obj_hash not null, -- requested object ID
    24
    25 task_uuid uuid not null, -- celery UUID of the cooking task
    26 task_status cook_status not null default 'new', -- status of the task
    27
    28 ts_created timestamptz not null default now(), -- timestamp of creation
    29 ts_done timestamptz, -- timestamp of the cooking result
    30 ts_last_access timestamptz not null default now(), -- last access
    31
    32 progress_msg text, -- progress message
    • not sure what this is, if it's progress info why it's in the DB and isn't task_status enough?

      if it's actually needed, a comment describing what this is for in the SQL would be nice :-)

    • status is just a way of checking whether the bundle is new, pending or done. progress is arbitrary data the cookers can fill to describe their progress, like "[phase 1/6] sorting revisions (54764/978784112)".

    • Please register or sign in to reply
  • just briefly reviewed the SQL schema, adding minor comments

    • requirements: python-fastimport module was renamed to fastimport
    • vault schema: fixup sql syntax
    • cooking_tasks: change celery queue name
    • cookers: rename revision_git to revision_gitfast
    • cookers: remove circular import in init.py
    • backend: fix db api
    • api: add email field
    • vault: initial database backend
    • vault: initial notification system
    • vault: fix tuple passing to cursor.execute()
    • vault: use uuid as schema type for celery uuid
    • requirements: python-fastimport module was renamed to fastimport
    • cooking_tasks: change celery queue name
    • cookers: rename revision_git to revision_gitfast
    • cookers: remove circular import in init.py
    • backend: fix db api
    • api: add email field
    • setup.py: update from storage to vault
    • cooking_tasks: use run_task() from swh.scheduler
    • backend: fix cooking task name
    • backend: fix database accesses
    • backend: prettier e-mail
    • revision_git: update progress_msg
  • Merge request was merged

  • Please register or sign in to reply
    Loading