Page MenuHomeSoftware Heritage

cassandra: Allow to configure the consistency level to use
ClosedPublic

Authored by vsellier on Jul 6 2021, 4:58 PM.

Details

Summary

The default ONE level is used to keep the previous behaviour

Related to T3396

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22497
Build 35051: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 35050: arc lint + arc unit

Unit TestsFailed

Event Timeline

Fix the task number in the commit message

Build has FAILED

Patch application report for D5974 (id=21523)

Rebasing onto f1cac4fcaa...

Current branch diff-target is up to date.
Changes applied before test
commit 232e76b45788106d6e03d2d0f990347c8f1560a2
Author: Vincent SELLIER <vincent.sellier@softwareheritage.org>
Date:   Tue Jul 6 16:54:57 2021 +0200

    cassandra: Allow to configure the consistency level to use
    
    The default ONE level is used to keep the previous behaviour
    
    Related to 3396

Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1349/
See console output for more information: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1349/console

Build has FAILED

Patch application report for D5974 (id=21524)

Rebasing onto f1cac4fcaa...

Current branch diff-target is up to date.
Changes applied before test
commit 22a41b088405b611719a6623ed98e8ecf3769b64
Author: Vincent SELLIER <vincent.sellier@softwareheritage.org>
Date:   Tue Jul 6 16:54:57 2021 +0200

    cassandra: Allow to configure the consistency level to use
    
    The default ONE level is used to keep the previous behaviour
    
    Related to T3396

Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1350/
See console output for more information: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1350/console

Build is green

Patch application report for D5974 (id=21525)

Rebasing onto f1cac4fcaa...

Current branch diff-target is up to date.
Changes applied before test
commit 936001b343d68057069199da2ef06b609b59adc0
Author: Vincent SELLIER <vincent.sellier@softwareheritage.org>
Date:   Tue Jul 6 16:54:57 2021 +0200

    cassandra: Allow to configure the consistency level to use
    
    The default ONE level is used to keep the previous behaviour
    
    Related to T3396

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1351/ for more details.

lgtm, one question and suggestions inline.

swh/storage/cassandra/cql.py
84

that's not a logging instruction so you can use f-string here ;)

106

Shouldn't this be consistent with the execution profile the CqlRunner uses?

No idea...

After checking which part is using this, it seems to be mostly a test utility function so i'm confused...
And there is no docstring for that function...

@vlorentz any hints?

swh/storage/tests/test_cassandra.py
251

Not to check the full log of the exception but to check the at the very least, it raises for the right reason.

ardumont added 1 blocking reviewer(s): Reviewers.
swh/storage/cassandra/cql.py
106

@vsellier showed me a use case [1]

Still, it'd be best this function clearly explains it's administration related in its docstring (outside the scope of this diff)

[1] https://forge.softwareheritage.org/source/snippets/browse/master/sysadmin/grid5000/cassandra/ansible/templates/swhstorage/init-cassandra-keyspace.sh

swh/storage/cassandra/cql.py
106

IMO it's not necessary at it's only to bootstrap the database.
It certainly needs some cares to include this in the standard initialization process.

swh/storage/cassandra/cql.py
106

my previous comment was the reply to

Shouldn't this be consistent with the execution profile the CqlRunner uses?

  • use a fstring to build the error message
  • check the error message content
swh/storage/cassandra/cql.py
106

yes, thanks, i understood it that way ;)

Build is green

Patch application report for D5974 (id=21532)

Rebasing onto f1cac4fcaa...

Current branch diff-target is up to date.
Changes applied before test
commit 9747aed6cbf1b31b87a8c3d00fe0177da357d056
Author: Vincent SELLIER <vincent.sellier@softwareheritage.org>
Date:   Tue Jul 6 16:54:57 2021 +0200

    cassandra: Allow to configure the consistency level to use
    
    The default ONE level is used to keep the previous behaviour
    
    Related to T3396

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1352/ for more details.

This revision is now accepted and ready to land.Jul 7 2021, 4:47 PM