Use timestamps to detect outdated cvmfs revisions
Hi Alex,
Here's a thought to Make Etf Green Again:
Currently, most of our ETF warning statuses are caused by outdated cvmfs repo's. These warnings are (usually) transient, and therefore of limited use.
Chris B suggest to use timestamps in stead of revision numbers to detect outdated cvmfs repo's: a client with a revision timestamp that is (say) more than 15 minutes older than the version on the Stratum-1 server should be flagged.
He also came up with a few snippets to determine these timestamps:
[lxplus937]$ attr -g root_hash /cvmfs/lhcb.cern.ch
Attribute "root_hash" had a 40 byte value for /cvmfs/lhcb.cern.ch:
bdf1db1bfe09f158d12f4230c4b7badc0a61ef53
[lxplus937]$ curl -L http://cvmfs-stratum-one.cern.ch/cvmfs/lhcb.cern.ch/data/bd/f1db1bfe09f158d12f4230c4b7badc0a61ef53C -o root_catalog.sql.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14995 100 14995 0 0 1830k 0 --:--:-- --:--:-- --:--:-- 1830k
[lxplus937]$ python3 -c "import zlib; open('root_catalog.sql', 'wb').write(zlib.decompress(open('root_catalog.sql.gz', 'rb').read()))"
[lxplus937]$ sqlite3 root_catalog.sql "SELECT value FROM properties WHERE key='last_modified';"
1761743709
[lxplus937]$ date -d '@1761743709'
Wed Oct 29 02:15:09 PM CET 2025
And to get the latest revision:
[lxplus937]$ curl -L http://cvmfs-stratum-one.cern.ch/cvmfs/lhcb.cern.ch/.cvmfspublished | grep --text --only-matching -P '(?<=C)([0-f]+)'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 598 100 598 0 0 74750 0 --:--:-- --:--:-- --:--:-- 74750
bdf1db1bfe09f158d12f4230c4b7badc0a61ef53
Or get the timestamp directly:
[lxplus937]$ curl -L http://cvmfs-stratum-one.cern.ch/cvmfs/lhcb.cern.ch/.cvmfspublished | grep --text --only-matching -P '(?<=T)([0-9]+)'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 598 100 598 0 0 194k 0 --:--:-- --:--:-- --:--:-- 194k
1761743711
What do you think?