Page MenuHomeSoftware Heritage

Update the archiver for the new db shema
ClosedPublic

Authored by qcampos on Jul 21 2016, 3:36 PM.

Diff Detail

Repository
rDSTO Storage manager
Branch
archiver
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 294
Build 432: Software Heritage Python tests
Build 431: arc lint + arc unit

Event Timeline

qcampos retitled this revision from to Update the archiver for the new db shema.
qcampos updated this object.
qcampos edited the test plan for this revision. (Show Details)
qcampos added a reviewer: ardumont.
qcampos added a subscriber: zack.

@ardumont : Submitted a first version for review, but there is still some work to do for the Jsonb access.

swh/storage/archiver/storage.py
74–82

FIXME: check how to alter direclty the json object with postgres for better efficiency.

qcampos edited edge metadata.

Remove string interpolation when constructing the db query

swh/storage/archiver/storage.py
74–82
swh/storage/archiver/worker.py
130

its mtime

swh/storage/db.py
665

Retrieve

684

'... its mtime...'

690–691

As this is a first draft, i imagine that you'll update the docstring later.
I'll say it nethertheless ^^

This seems quite ok so far.

Submitted a first version for review, but there is still some work to do for the Jsonb access.

What do you mean?
The jsonb access for the update?

qcampos marked 6 inline comments as done.
qcampos edited edge metadata.
In D79#1796, @ardumont wrote:

The jsonb access for the update?

Yes, I used the jsonb_set function to let postgres do the update.

  • Use postgres 9.5's functions for jsonb manipulation
  • Some typos corrections
qcampos edited edge metadata.
  • Correct the content_archive_update in order to follow properly its contract
swh/storage/db.py
695

Indeed, postgres would not let us do that.
What's strange is that it was not captured by test.

qcampos edited edge metadata.
  • Do some corrections on the archiver director
qcampos added inline comments.
swh/storage/db.py
695

It should have been captured. If the test was launched. :)

swh/storage/tests/test_archiver.py
144

That was pretty confusing.

ardumont edited edge metadata.
ardumont added inline comments.
swh/storage/tests/test_archiver.py
144

/o\
but awesome that you saw it ^^

150

you can remove the comment then since you made it in code (which is cooler ^^)

This revision is now accepted and ready to land.Jul 21 2016, 6:49 PM
This revision was automatically updated to reflect the committed changes.
qcampos marked an inline comment as done.