3b94bd45406f9d457d37caa10c856a19c4cec22a
465 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
Mingyu Li
|
3b94bd4540 |
Keep the Usage of exit()/sys.exit() Consistent
It's better to keep the usage of exit()/sys.exit() consistent in one file. Furthermore, sys.exit() is considered good to be used in production code, while exit is for interactive shell. Change-Id: Ia3092853a648922588e2bc11db37d6decdec1b48 |
||
|
Jenkins
|
dd405d9dd4 | Merge "Fix ClientException handling in Container Sync" | ||
|
Hisashi Osanai
|
23c7a58f8f |
Fix ClientException handling in Container Sync
swift/container/sync.py uses swift.common.internal_client.delete_object and put_object and expected these methods raise ClientException. But delete_object and put_object never raise the exception so this patch raises ClientException when urllib2 library raises HTTPError. Co-Authored-By: Eran Rom <eranr@il.ibm.com> Closes-Bug: #1419901 Change-Id: I58cbf77988979a07998a46d9d81be84d29b0d9bf |
||
|
Ondřej Nový
|
3b1591f235 |
swift-init: New option kill-after-timeout
This option send SIGKILL to daemon after kill_wait period. When daemon hangs and doesn't respond to SIGTERM/SIGHUP there is no way to stop it using swift-init now. Classic init scripts in Linux kills hanged process after grace period and this patch add same behaviour. This is most usefull when using "restart" on hanged daemon. Change-Id: I8c932b673a0f51e52132df87ea2f4396f4bba9d8 |
||
|
Jenkins
|
b37205fe2d | Merge "Improve swift-init usage statement" | ||
|
Alistair Coles
|
e06c874394 |
Improve swift-init usage statement
Clarify the behavior of strict and non-strict options. Define what <server> and <config> specify on the command line. Drive-by fix for missing param in search_tree docstring. Change-Id: I89fff88a088bc73001464b1fa8240e14a61a117d |
||
|
Jenkins
|
caebea16d6 | Merge "swift-init return codes" | ||
|
Zack M. Davis
|
1b8b08039a |
remove remaining simplejson uses, prefer standard library import
|
||
|
Lisak, Peter
|
7b7c6c5249 |
swift-init return codes
Currently, swift-init returns zero if can't locate config on start. Because of this problem, it is not possible to distinguish if managed to start server. Due to legacy two new complementary options are added. Default is context dependent. --strict returns non-zero if some config is missing (default mode if explicitly named server) --non-strict returns zero even if some config is missing (default mode if alias is used) As a side effect: If some of demanded servers already running it does not try to start unstarted and also returns non-zero (in strict mode). That is still sufficient for the goal of patch. For future improvements LSB status codes should be considered. DocImpact Change-Id: I7750abd4a94875b46f83f4aeee8509388d543c2b |
||
|
Victor Stinner
|
c0af385173 |
py3: Replace urllib imports with six.moves.urllib
The urllib, urllib2 and urlparse modules of Python 2 were reorganized into a new urllib namespace on Python 3. Replace urllib, urllib2 and urlparse imports with six.moves.urllib to make the modified code compatible with Python 2 and Python 3. The initial patch was generated by the urllib operation of the sixer tool on: bin/* swift/ test/. Change-Id: I61a8c7fb7972eabc7da8dad3b3d34bceee5c5d93 |
||
|
Jenkins
|
6a9b868ae6 | Merge "Python3: Fix Remaining issues of python3 compatibility in bin directory" | ||
|
Samuel Merritt
|
e02609c66a |
Preserve traceback in swift-dispersion-report
Commit
|
||
|
Kazuhiro MIYAHARA
|
c690bcb683 |
Fix dispersion-reports error message
This patch fixes Swift to show message "No objects to query. Has swift-dispersion-populate been run?" for "swift-dispersion-report —object-only" with no container for object dispersion. Change-Id: I82da56709cfc296a27f5180681709bc56adbc13d Closes-Bug: #1468120 |
||
|
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 |
||
|
Jenkins
|
e1683fdb2e | Merge "Support keystone v3 domains in swift-dispersion" | ||
|
Victor Stinner
|
d719064e78 |
Fix warning pep8 E128 warning of hacking 0.10
Fix the warning E128: "continuation line under-indented for visual indent" of pep8. Change-Id: Ie6c6ae341fe3d6281f2095c1d756d552fa5937f9 |
||
|
Falk Reimann
|
363a256e58 |
Support keystone v3 domains in swift-dispersion
This provides the capability to specify a project_name, project_domain_name and user_domain_name in /etc/swift/dispersion.conf. If this values are set in dispersion.conf they get populated to the swift-client. With this it is possible to have a specific dispersion project specified, which is not the keystone default domain. Changes were applied to swift-dispersion-populate and swift-dispersion-report. Relevant man pages, the example dispersion.conf and the admin guide were updated accordingly. DocImpact Closes-Bug: #1468374 Change-Id: I0e716f8d281b4d0f510bc568bcee4a13fc480ff7 |
||
|
janonymous
|
78cb608ff7 |
Python3: Fix Remaining issues of python3 compatibility in bin directory
Changes Of py3 in bin : * https://review.openstack.org/#/c/196835/ * ConfigParser from six.moves Change-Id: Ic0374c8e09dfd595ec12c4d31b17dad30eaa803c |
||
|
Victor Stinner
|
6e70f3fa32 |
Get StringIO and cStringIO from six.moves
* replace "from cStringIO import StringIO" with "from six.moves import cStringIO as StringIO" * replace "from StringIO import StringIO" with "from six import StringIO" * replace "import cStringIO" and "cStringIO.StringIO()" with "from six import moves" and "moves.cStringIO()" * replace "import StringIO" and "StringIO.StringIO()" with "import six" and "six.StringIO()" This patch was generated by the stringio operation of the sixer tool: https://pypi.python.org/pypi/sixer Change-Id: Iacba77fec3045f96773d1090c0bd48613729a561 |
||
|
Jenkins
|
395b703305 | Merge "Replace dict.iteritems() with dict.items() in bin directory of swift." | ||
|
Jenkins
|
668d543c86 | Merge "Add ring-builder analyzer." | ||
|
janonymous
|
cd20961abd |
Replace dict.iteritems() with dict.items() in bin directory of swift.
The iteritems() of Python 2 dictionaries has been renamed to items() on Python 3. Change-Id: I4bdc064c90bab56cd60f2dca2a5a78426ffbb31c |
||
|
janonymous
|
8eca02d3a1 |
Replace xrange() with six.moves.range()
xrange is no longer available in py3. replacing xrange with range from six.moves Change-Id: Ib863c316a0724bd9c4f53c2e5a8d1bcd42c4dc5a |
||
|
Samuel Merritt
|
ccf0758ef1 |
Add ring-builder analyzer.
This is a tool to help developers quantify changes to the ring builder. It takes a scenario (JSON file) describing the builder's basic parameters (part_power, replicas, etc.) and a number of "rounds", where each round is a set of operations to perform on the builder. For each round, the operations are applied, and then the builder is rebalanced until it reaches a steady state. The idea is that a developer observes the ring builder behaving suboptimally, writes a scenario to reproduce the behavior, modifies the ring builder to fix it, and references the scenario with the commit so that others can see that things have improved. I decided to write this after writing my fourth or fifth hacky one-off script to reproduce some bad behavior in the ring builder. Change-Id: I114242748368f142304aab90a6d99c1337bced4c |
||
|
Jenkins
|
f5d6f8c23a | Merge "Add policy support to dispersion tools" | ||
|
paul luse
|
e6165a7879 |
Add policy support to dispersion tools
Doesn't work for anything other than policy 0. updated to allow user to specify policy name on cmd line (as with object-info) which then makes populate/report work with 3x, 2x, or EC style policies Change-Id: Ib7c298f0f6d666b1ecca25315b88539f45cf9f95 Closes-Bug: 1458688 |
||
|
Mark Seger
|
af734b3fb6 |
Change usage help and Attention messages to warnings
Change-Id: I1396aaffe36e739606f15f7fef37b11bd83f1fc1 |
||
|
paul luse
|
647b66a2ce |
Erasure Code Reconstructor
This patch adds the erasure code reconstructor. It follows the design of the replicator but: - There is no notion of update() or update_deleted(). - There is a single job processor - Jobs are processed partition by partition. - At the end of processing a rebalanced or handoff partition, the reconstructor will remove successfully reverted objects if any. And various ssync changes such as the addition of reconstruct_fa() function called from ssync_sender which performs the actual reconstruction while sending the object to the receiver Co-Authored-By: Alistair Coles <alistair.coles@hp.com> Co-Authored-By: Thiago da Silva <thiago@redhat.com> Co-Authored-By: John Dickinson <me@not.mn> Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Co-Authored-By: Tushar Gohad <tushar.gohad@intel.com> Co-Authored-By: Samuel Merritt <sam@swiftstack.com> Co-Authored-By: Christian Schwede <christian.schwede@enovance.com> Co-Authored-By: Yuan Zhou <yuan.zhou@intel.com> blueprint ec-reconstructor Change-Id: I7d15620dc66ee646b223bb9fff700796cd6bef51 |
||
|
Lorcan
|
0a46793662 |
Add swift-recon feature to track swift-drive-audit error count
This is a follow-on from a previous commit which added recon info for swift-drive-audit (https://review.openstack.org/#/c/122468/). Here, the "--drievaudit" option is added to swift-recon tool. This feature gives the statistics for the system-wide drive errors flagged by swift-drive-audit. An example of the output is as follows: (verbose mode) swift-recon --driveaudit -v =============================================================================== --> Starting reconnaissance on 5 hosts =============================================================================== [2015年03月11日 17:13:39] Checking drive-audit errors -> http://1.2.3.4:6000/recon/driveaudit: {'drive_audit_errors': 14} -> http://1.2.3.5:6000/recon/driveaudit: {'drive_audit_errors': 0} -> http://1.2.3.6:6000/recon/driveaudit: {'drive_audit_errors': 37} -> http://1.2.3.7:6000/recon/driveaudit: {'drive_audit_errors': 101} -> http://1.2.3.8:6000/recon/driveaudit: {'drive_audit_errors': 0} [drive_audit_errors] low: 0, high: 101, avg: 30.4, total: 152, Failed: 0.0%, no_result: 0, reported: 5 =============================================================================== Change-Id: Ia16c52a9d613eeb3de1a5a428d88dd1233631912 |
||
|
Jenkins
|
49586c6ed7 | Merge "Prevent redundant commenting by drive-audit" | ||
|
Takashi Kajinami
|
a270dca239 |
Prevent redundant commenting by drive-audit
The drive-audit detects error log about a device and comments out it in /etc/fstab. When the error log is generated several times, it comments out the line for each time. This patch makes drive-audit to check if the device is already commented out, and prevents redundant commenting out. Change-Id: Ia542d35b58552dde0f324bb9c42531f98c9058fa |
||
|
Samuel Merritt
|
3ac43e8299 |
Allow per-policy overrides in object replicator.
The replicator already supports --devices and --partitions to restrict its operation to a subset of devices and partitions. However, operators don't always want to replicate a partition in all policies since different policies (usually) have different rings. For example, if I know that policy 0's partition 1234 is has no replicas on primary nodes due to over-aggressive rebalancing, I really want to find a node where the partition isa and make the replicator push it onto the primaries. However, if I haven't been messing with policy 1's ring, its partition 1234 is fine. With the existing replicator args, I get both or neither; this commit lets me get just the useful one. Change-Id: Ib1d58fdd228a6ee7865321e65d7c04a891fa5c49 |
||
|
Keshava Bharadwaj
|
1ffe6b3953 |
Adds console logging to swift-drive-audit
This patch adds console logging ability to swift-drive-audit. There are cases where logging to console is necessary when drive-audit is done. This can be consumed for flagging errors in monitoring tools such as icinga. DocImpact Change-Id: Ia1e1effcbd89bd2cf6d5b8c64019f1647c736a3a |
||
|
Cedric Dos Santos
|
a8751ae557 |
Correct misspelled words
In some files I found misspelling words. bin/swift-reconciler-enqueue#l26 primarly => primarily swift/account/backend.py#l309 ommited => omitted swift/container/replicator.py#l158 successfull => successful test/unit/account/test_backend.py#1450 non_existant_policy_index => non_existent_policy_index test/unit/account/test_backend.py#1451 'test-non-existant-policy'=> 'test-non-existent-policy' test/unit/account/test_backend.py#1453 non_existant_policy_index => non_existent_policy_index Change-Id: I976236e3200a6fbdc20be464acff182b6cface81 |
||
|
Daisuke Morita
|
2792fe81a9 |
Show the sum of every policy's amount in /recon/async
After the release of Swift ver. 2.0.0, some recon responses do not
show each policy's information yet. To make things worse, some recon
results only count on policy-0's score, therefore the total is not
shown in the recon results.
With this patch, async_pending count of recon results becomes
policy-aware. Suppose a number of async_pending files for policy-0 is 2
and a number for policy-1 is 3, recon sums up every policy's amount
as follows.
$ curl http://<host>:<port>/recon/async
{"async_pending": 5} # It showed 2 before this commit
Related-Bug: 1375332
Change-Id: Ifc88b8c9e06b9f022a926a87ed807e938e1e0412
|
||
|
Filippo Giunchedi
|
dec9448c87 |
swift-drive-audit: pass logger to get_errors
Closes-Bug: #1379767 Change-Id: Ie8ec5e9ffb977ab39aedeb878e6aae9f0b62530b |
||
|
Jenkins
|
8647f86494 | Merge "Add new features to swift-drive-audit" | ||
|
Lorcan
|
cb20763893 |
Add new features to swift-drive-audit
This patch adds two new features to swift-drive-audit. The first
is an option in the drive-audit.conf file that allows the operator
to prevent the drives ever being unmounted automatically,
regardless of the amount of errors present. This could be of
benefit in very small systems consisting of only one or two drives
where the operator would like to manually unmount/fix the
particular drive(s) and minimise any potential downtime.
The second is another option in drive-audit.conf that allows the
operator to select a recon directory. This directory will then
have a drive.recon file which will keep an up-to-date record of
the swift drives and any errors associated with them. An example
of the output would be as follows:
{"/srv/node/disk2": "0", "/srv/node/disk3": "25", "/srv/node/disk0": "0",
"/srv/node/disk1": "0", "/srv/node/disk10": "0", "/srv/node/disk7": "0",
"/srv/node/disk4": "137", "/srv/node/disk5": "0", "/srv/node/disk8": "0",
"/srv/node/disk9": "0", "/srv/node/disk6": "0", "/srv/node/disk11": "60"}
This would allow the operator to monitor the errors on the swift
drives without having to spend time searching through logs. Also, if
this is accepted, it should be possible to add an option to
swift-recon that would keep track of this at a system level.
Change-Id: Ib5dacf8622b7363e070c274c7c30c8ead448a055
|
||
|
Jenkins
|
607e2ed2e3 | Merge "Add "--no-overlap" option to swift-dispersion populate" | ||
|
Lorcan
|
4faf170270 |
Add "--no-overlap" option to swift-dispersion populate
This change allows the user to use a "--no-overlap" parameter when running the tool multiple times. It will increase the coverage by whatever is specified in the dispersion_coverage field of the conf file in a manner where existing container/objects are left in place and no partition is populated more than once. Related-Bug: #1233045 Change-Id: I139fed2f4c967ba18d073b7ecd1e946ed4da1271 |
||
|
John Dickinson
|
b7281cf2c5 |
make the bind_port config setting required
In a long-term effort to change the recommended ports for Swift, the first step is to require the bind_port in config files. Later, we can change the recommended setting. Anyone currently explicitly setting the ports will not be affected. Anyone not setting the ports will need to specify them to match their rings. DocImpact Change-Id: Icca83a263acdd0afc9016424a3e9f8c15e944789 |
||
|
Samuel Merritt
|
4f2bb9f271 |
Make swift-form-signature testable
Moved the body of bin/swift-form-signature into swift/cli/form_signature.py, like was done with swift-ring-builder and others. Added a couple basic tests; there's not 100% coverage, but it's better than the 0% coverage we had before. It's almost a straight forklift, but I changed exit() calls to return statements. Change-Id: Ie2f702c070da24d9cdface83b9e838e9e2965085 |
||
|
Yuan Zhou
|
6cc10d17de |
Update bin scripts to be storage policy aware
swift-container-info: Print policy container info swift-object-info: Allow to specify storage policy name when looking for object info Notify if there is missmatch between ring location and the actual object path in filesystem swift-get-nodes: Allow to specify storage policy name when looking for account/ container/object ring location Notify if there is missmatch between ring and the policy Lookup policy name in swift.conf; 'Legacy' container will use policy-0's name; 'Unknown' is shown if policy not found in swift.conf DocImpact Implements: blueprint storage-policies Change-Id: I450d40dc6e2d8f759187dff36d658e52737ae2a5 |
||
|
Clay Gerrard
|
3fc4d6f91d |
Add container-reconciler daemon
This daemon will take objects that are in the wrong storage policy and move them to the right ones, or delete requests that went to the wrong storage policy and apply them to the right ones. It operates on a queue similar to the object-expirer's queue. Discovering that the object is in the wrong policy will be done in subsequent commits by the container replicator; this is the daemon that handles them once they happen. Like the object expirer, you only need to run one of these per cluster see etc/container-reconciler.conf. DocImpact Implements: blueprint storage-policies Change-Id: I5ea62eb77ddcbc7cfebf903429f2ee4c098771c9 |
||
|
Jenkins
|
c384d76c57 | Merge "Add --quoted option to swift-temp-url" | ||
|
Chuck Thier
|
0a122c1575 |
Add targeted config loading to swift-init
This allows an easier and more explicit way to tell swift-init to run on specific servers. For example with an SAIO, this allows you to do something like: swift-init object-server.1 reload to reload just the 1st object server. A more real world example is when you are running separate servers for replication. In this example you might have an object-server/public.conf and object-server/replication.conf. With this change you can do something like: swift-init object-server.replication reload to just reload the replication server. DocImpact Change-Id: I5c6046b5ee28e17dadfc5fc53d1d872d9bb8fe48 |
||
|
Clay Gerrard
|
b7659bee26 |
Add --quoted option to swift-temp-url
If you have a path with special characters it may be easier to hand them to swift-temp-url prequoted than try to escape them on the command line. By the time common.middleware.tempurl gets ahold of the path it's unquoted so we do the same before calculating the hmac but still use the pre-quoted path output to the commandline. Change-Id: Ia1a9666e487b1e70e4db7cd597bc6a1027e3e918 |
||
|
Luis de Bethencourt
|
3af5216543 |
Sort the log file dates in reverse order
We want to show log files in descending order. Change-Id: I6f79d9f5a73afa43efec36c3ca99afcde3fe7813 Closes-Bug: #1311405 |
||
|
Yuan Zhou
|
39f5eab890 |
Clean up swift-{account, container}-info
Reuse common code; add unit tests; ensured coverage was at 100%. Change-Id: Id6fcc7cb07fd178e00d43968e3e2cc03226fdc05 |
||
|
Jenkins
|
6e44a8499a | Merge "Update swift-get-nodes to use storage_directory util func" |