11eb17d3b268258a1fa60957e33d5cbe8566db98
Commit Graph

10 Commits

Author SHA1 Message Date
Matthew Oliver
52c80d652d cli: add --sync to db info to show syncs
When looking at containers and accounts it's sometimes nice to know who
they've been replicating with. This patch adds a `--sync|-s` option to
swift-{container|account}-info which will also dump the incoming and
outgoing sync tables:
 $ swift-container-info /srv/node3/sdb3/containers/294/624/49b9ff074c502ec5e429e7af99a30624/49b9ff074c502ec5e429e7af99a30624.db -s
 Path: /AUTH_test/new
 Account: AUTH_test
 Container: new
 Deleted: False
 Container Hash: 49b9ff074c502ec5e429e7af99a30624
 Metadata:
 Created at: 2022年02月16日T05:34:05.988480 (1644989645.98848)
 Put Timestamp: 2022年02月16日T05:34:05.981320 (1644989645.98132)
 Delete Timestamp: 1970年01月01日T00:00:00.000000 (0)
 Status Timestamp: 2022年02月16日T05:34:05.981320 (1644989645.98132)
 Object Count: 1
 Bytes Used: 7
 Storage Policy: default (0)
 Reported Put Timestamp: 1970年01月01日T00:00:00.000000 (0)
 Reported Delete Timestamp: 1970年01月01日T00:00:00.000000 (0)
 Reported Object Count: 0
 Reported Bytes Used: 0
 Chexor: 962368324c2ca023c56669d03ed92807
 UUID: f33184e7-56d5-4c74-9d2e-5417c187d722-sdb3
 X-Container-Sync-Point2: -1
 X-Container-Sync-Point1: -1
 No system metadata found in db file
 No user metadata found in db file
 Sharding Metadata:
 Type: root
 State: unsharded
 Incoming Syncs:
 Sync Point	Remote ID 	Updated At
 1 	ce7268a1-f5d0-4b83-b993-af17b602a0ff-sdb1	2022年02月16日T05:38:22.000000 (1644989902)
 1 	2af5abc0-7f70-4e2f-8f94-737aeaada7f4-sdb4	2022年02月16日T05:38:22.000000 (1644989902)
 Outgoing Syncs:
 Sync Point	Remote ID	Updated At
 Partition	294
 Hash 	49b9ff074c502ec5e429e7af99a30624
As a follow up to the device in DB ID patch we can see that the replicas
at sdb1 and sdb4 have replicated with this node.
Change-Id: I23d786e82c6710bea7660a9acf8bbbd113b5b727
2024年01月16日 08:19:08 -08:00
Tim Burke
1f9b879547 Run flake8 on bin/ files
Change-Id: I58d4b5a00e97785584c6d3bd8b06243f481c1934
2021年02月01日 13:26:53 -08:00
Tim Burke
67e3830ab9 swift-container-info: Show shard ranges summary
The current behavior is really painful when you've got hundreds of shard
ranges in a DB. The new summary with the states is default. Users can
add a -v/--verbose flag to see the old full detail view.
Change-Id: I0a7d65f64540f99514c52a70f9157ef060a8a892
2020年07月22日 12:29:53 -05:00
Tim Burke
5b68eb5396 swift-(account|container)-info: tolerate LockTimeouts
I'm not really clear on why a sqlite3.OperationalError should cause us to
retry with stale_reads_ok=True, but swift.common.exceptions.LockTimeout
*definitely* should.
Change-Id: I707dec1d11b8db80bc8fbee30662b319bf10d6a5
2018年04月10日 17:09:07 -07:00
Tim Burke
f95befb37f Optionally drop common prefixes in swift-*-info output
Add a --drop-prefixes flag to swift-account-info, swift-container-info,
and swift-object-info. This makes the output between the three more
consistent.
Change-Id: I98252ff74c4983eaad0a93d9a9fc527c74ffce68
2017年09月13日 22:47:04 +00:00
Janie Richling
e97c4f794d swift-[account|container]-info when disk is full
Extended the use of the DatabaseBroker "stale_reads_ok" flag to the
AccountBroker and ContainerBroker. Now checks for an sqlite3 error
from the _commit_puts call that processes the pending files.
If this error is raised, then the stale_reads_ok flag will be checked
to determine how to proceed as opposed to simply raising.
The first time that print_info is attempted, the flag will be
false, but swift-[account|container]-info will check for the
raised exception. If it was raised, then a warning is reported
that the data may be stale, and another attempt will be
made using the stale_reads_ok=True flag.
Change-Id: I761526eef62327888c865d87a9caafa3e7eabab6
Closes-Bug: 1531302
2016年03月24日 20:11:24 -05:00
kenichiro matsuda
81816bebe6 Fix shebang of commands
Fix shebang of following commands.
 $ grep '#!/usr/bin/python' swift/bin/*
 swift/bin/swift-account-info:#!/usr/bin/python
 swift/bin/swift-container-info:#!/usr/bin/python
 swift/bin/swift-container-sync:#!/usr/bin/python
 swift/bin/swift-recon:#!/usr/bin/python
 swift/bin/swift-ring-builder:#!/usr/bin/python
 swift/bin/swift-ring-builder-analyzer:#!/usr/bin/python
Change-Id: I564d1d8abd76eba57730fc2f30263b0a0f809867
Closes-Bug: #1481623 
2015年08月06日 11:02:40 +09:00
Yuan Zhou
39f5eab890 Clean up swift-{account, container}-info
Reuse common code; add unit tests; ensured coverage was at 100%.
Change-Id: Id6fcc7cb07fd178e00d43968e3e2cc03226fdc05
2014年04月03日 09:54:58 -04:00
Clay Gerrard
12c9dbe5f7 minor cleanups for swift-container-info
Change-Id: I4d0687f64524093e2ffaa4f8d31bcff70dca145e
2014年03月26日 13:26:13 -07:00
Madhuri Kumari
6b441fabd9 Added swift-container-info tool.
This is a very simple swift tool to retrieve information
of a container that is located on the storage node.
One can call the tool with a given container db file
as it is stored on the storage node system.
It will then return several information about that container.
Change-Id: Ifebaed6c51a9ed5fbc0e7572bb43ef05d7dd254b
2014年03月22日 17:30:20 +05:30