Commit Graph

420 Commits

Author SHA1 Message Date
OpenDev Sysadmins 9d05b1a238 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:50:51 +00:00
zhangyangyang 48a4c8b493 change assert(Not)Equals to assert(Not)Equal
According to http://docs.python.org/2/library/unittest.html
assert(Not)Equals is a deprecated alias of assert(Not)Equal.

Change-Id: I75845cb9b71bcbaec76e12492b38260e09a2df13
Closes-Bug: #1329757
2017-09-14 14:54:05 +08:00
Jenkins 73672a47a4 Merge "List system dependencies for running common tests" 2017-08-17 20:14:08 +00:00
Arundhati Surpur 29baaefc99 Update .gitignore
Because egg* already ignores egg-info.

Change-Id: Ide82070384e78cab2ceee43c0f0c998c80ccc517
2017-07-07 17:46:58 +05:30
Andreas Jaeger b1dea6eacd List system dependencies for running common tests
Add a bindep.txt file containing a cross-platform list
of dependencies needed for running included tox-based tests. Also
include a tox environment for convenience calling the bindep[*]
utility to list any missing system requirements.

This change is self-testing.

For bindep.txt see also
http://docs.openstack.org/infra/manual/drivers.html#package-requirements

[*] http://docs.openstack.org/infra/bindep/

Change-Id: I4046952603dddcd7290ec13be26fd09ea7fc608a
2016-08-11 19:38:56 +02:00
Jenkins b439f20f9c Merge "Don't (f)chown when it has no effect" 2016-06-14 18:17:07 +00:00
Jenkins 1de8091ce8 Merge "Open object only if it's going to be read" 2016-06-14 18:16:24 +00:00
Jenkins 35601d4191 Merge "Handle non-blocking renames during object PUTs" 2016-06-14 17:36:19 +00:00
Jenkins a52274de32 Merge "Remove redundant syscalls in POST path" 2016-06-13 19:55:02 +00:00
Prashanth Pai 72dbd476f0 Don't (f)chown when it has no effect
For (f)chown calls which can change both UID and GID at once, -1 is
reserved as a sentinel value to indicate "omitted argument" or "do
not change". This makes sense when one of the args to (f)chown is -1.
When both uid and gid args are -1, it doesn't make sense to call
(f)chown as neither is going to be changed.

Further, as of today, diskfile doesn't get the information (uid and
gid) of the authenticated user from auth middleware. Retained the
calls in code for future when such functionality might be added.

This is a port of the following change:
http://review.gluster.org/#/c/13778

Change-Id: I74f1fa50bdfea30b404ac941b4345d8a94d5d141
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2016-05-19 12:38:40 +05:30
Prashanth Pai e8d31d9e9a Open object only if it's going to be read
Open()ing an object is necessarry only in two cases:
* Serving a GET request
* Recalculating etag when metadata is stale
  (can be triggered by any type of request)

This change ensures that for requests other than GET, a file is not
opened if the metadata is valid (size and etag accurate). Note that
if metadata is stale, the file is still opened and read to compute etag.
This patch does not change the behaviour of triggering metadata
validation and regeneration for non-GET requests.

This is a port of following change:
http://review.gluster.org/#/c/13684/

Change-Id: I54caf2242dfe94c1feb1060abfba971f862587fa
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2016-05-19 12:38:29 +05:30
Prashanth Pai 87de09c9ec Handle non-blocking renames during object PUTs
DiskFile._finalize_put() will now retry renames if it fails with EBUSY
or ESTALE. This is required because for a brief period of time, rename
operation in glusterfs was non-blocking.
Reference: http://review.gluster.org/#/c/13366/

This change also does the following:
* Updates comments to add clarity for operations done and exceptions
  caught in DiskFile.create()
* Handles race between container existance check (memcache) and
  object creation a little more gracefully by logging what really
  happened.

This is port of following change:
http://review.gluster.org/#/c/14118

Change-Id: I1e993f5fed5c75bb77bee0620e1e7104f7f69deb
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2016-05-19 11:45:39 +05:30
Prashanth Pai 4252ff6cc4 Remove redundant syscalls in POST path
During process of POST requests which updates object metadata (xattrs),
the following (ordered) sequence of syscalls were being made twice:
open(), fstat(), fgetxattr(), close()

Intuitively, one may assume that a getxattr() and setxattr() is enough
to fulfil the POST request as it is only supposed to update metadata.
But this isn't the case. The above series of syscalls is made first
during disk_file.open(). This will trigger an update of all stale
metadata (outdated size/etag) and the result is retained in a diskfile
class attribute named 'self._metadata'

Instead of using this pre-fetched metadata, the POST path was internally
invoking disk_file.open() again in disk_file.write_metadata(). This is
redundant and serves no purpose. self._metadata was being erased during
the context manager cleanup of disk_file.open()

This change is simple and does the following:
* Don't erase fetched metadata during context manager exit of open()
* Use a different internal variable to detect and raise DiskFileNotOpen
* Re-use self._metadata if available in disk_file.write_metadata()

Here's comparing syscalls made (POST path) with and without this fix:
https://bugzilla.redhat.com/show_bug.cgi?id=1314171#c4

This is a port of this change:
http://review.gluster.org/#/c/13668/

Change-Id: I74e6f849f4415f3816bb367e1900924a76bf19c1
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2016-05-19 11:37:44 +05:30
Prashanth Pai d137fefb5a Fix dup fd leak
A fd was not being closed after it was duplicated. This code path can
be easily hit when doing a GET on a file that needs Etag (md5sum) to
be recalculated.

Change-Id: I3ea5ae5b30f38797d4367a65239716832e344431
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2016-03-08 12:27:40 +05:30
Prashanth Pai 328c5549bf Update spec file for 2.5.0 release
Change-Id: Ie72ce4cbdf8d0c0dfe3fa7fd3e4a98b7252ab684
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-12-23 11:40:16 +05:30
Prashanth Pai c649130a1f Set version to 2.5.0
Change-Id: I2f9ed5aec822d01ad77f36a70e293953bfe19e4d
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-12-23 10:42:16 +05:30
Jenkins b562c56729 Merge "Rebase to Swift 2.5.0 (liberty)" 2015-12-22 18:42:01 +00:00
Prashanth Pai a8f474d844 Rebase to Swift 2.5.0 (liberty)
Change-Id: I2743c6fd2b2579751b5d03dacf320401f08563b1
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-12-14 12:43:56 +05:30
Ondřej Nový 7a6d68e7a3 Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: Ic576b1e453b1884beb5b30d920baf78f2023f69b
2015-12-11 21:28:52 +01:00
Jenkins 55857a2e21 Merge "doc: Last write wins behaviour" 2015-12-08 14:00:40 +00:00
Prashanth Pai 0475666746 doc: Last write wins behaviour
Change-Id: I1ef2dbc167921a9b08c8b0cd7f240082adc16a0e
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-12-08 19:01:50 +05:30
Jenkins ea0ecdf985 Merge "Introduce fallocate support" 2015-12-08 12:55:50 +00:00
Jenkins cc1051f031 Merge "Fix func test incorrect test result" 2015-12-08 12:51:46 +00:00
Prashanth Pai 9e65dd9ceb Introduce fallocate support
fallocate() allows for reserving disk space for a particular inode and
fd. Hence, a client can be sure that he won't see a ENOSPC (eventually
a 507 HTTP response) later during writes. Swift's object server has
had fallocate() support from a long time.

P.S: Older versions of glusterfs (<3.6) did not support fallocate
because FUSE did not support it earlier.
http://review.gluster.org/4969
http://fuse.996288.n3.nabble.com/fallocate-support-in-FUSE-td10668.html

Change-Id: Ida4b16357901707d624f92bf1b2dc8f07da4f1ad
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-12-08 11:06:55 +05:30
Prashanth Pai b8eb887b81 Fix func test incorrect test result
Running `tox -e functest` when swift services are not running
is incorrectly reported as success! The fix for this borrowed
from here: https://review.openstack.org/235933

Also, sphinx package is not needed in swiftonfile as we do not
have docs to build.

Change-Id: I675a438367497bc9a3c4aca21a0e48458673ab04
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-11-20 11:25:03 +05:30
Prashanth Pai 60eaebbb01 Remove redundant syscalls
This will optimize the first GET on files added from file interface.
More info: https://gist.github.com/prashanthpai/62e0bec770421561ea79

Change-Id: I3f0fd897eedf1413c3e7d5dca0f6196c62549fcb
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-11-20 11:12:30 +05:30
Prashanth Pai 8bce87a2bb Minor cleanups
* Make bin/* scripts pep8 compliant
* Cleanup tox.ini
* Update references of old repo
* Add swiftonfile-migrate-metadata to spec file

Change-Id: Icfa29cffcedfc357ab860a9023b3adfdbf3eeee8
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-11-17 17:55:23 +05:30
Jenkins 3115575d5d Merge "Detect file change when file size remains same" 2015-11-10 19:42:01 +00:00
Prashanth Pai 435a0dcfc7 Do not use pickle: Use json
Change-Id: Ic4217e82fc72f9a32c13136528e1bc3cc05d0c73
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-11-04 18:53:41 +05:30
Prashanth Pai fbc07d3ad9 Refactor read_metadata() method
This change:
* Simplifies read_metadata() method.
* Validates pickle header before attempting to unpickle.

Change-Id: I08d4187f7f4cc963d095b2cd2bcee3039a7dc858
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-10-21 15:46:27 +05:30
Jenkins eb9abdc934 Merge "Change repositories from stackforge to openstack" 2015-10-19 18:19:26 +00:00
Jenkins fc1ee9298f Merge "Remove keyword arguments from os.open call, instead add check for mode bits" 2015-10-19 18:19:24 +00:00
venkatamahesh 21f6fa7172 Change repositories from stackforge to openstack
Change-Id: Id1cecf2e55128494684c7f7bd23600b52fd5b6cb
2015-10-19 23:34:53 +05:30
Jeremy Stanley 94ce66ee88 Update .gitreview for new namespace
Change-Id: Ica3efb65cc4af18c1d73449ccc1c5b6bbf3e75cf
2015-10-17 22:40:40 +00:00
Varun Mittal 481d2226b1 Remove keyword arguments from os.open call, instead add check for mode bits
The open() method of OS module don't have any keyword arguments and would fail
with exceptions if **kwargs is passed.
Instead, I have added mode as named argument with 0o777 as default mode for
os.open() call

Change-Id: I5628883f4fb5ef7f08944673b0e5cc09bc166540
Signed-off-by: Varun Mittal <varun.mittal@in.ibm.com>
2015-10-14 08:57:36 +05:30
Prashanth Pai da53693c9b Detect file change when file size remains same
There was a corner case where Etag returned would be incorrect. This
happens when the object is changed from file interface but with object
size remaining the same.

This change introduces an additional metadata that stores the mtime of
object during PUT. This stored mtime is compared with actual mtime
during GET to determine if the file has changed or not. Etag is
recalculated if the file has changed.

The scope of this fix in addressing the above mentioned corner case is
limited to new objects only. Also, refactoring the code further by
moving some methods from utils.py to classes in diskfile.py should
prevent some redundant (f)stat syscalls. These minor optimizations
will be addressed in a separate change.

Change-Id: If724697ef2b17a3c569b60bd81ebf98dab283da6
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-10-08 14:30:12 +05:30
Prashanth Pai 3083d14aff Fix inconsistent data being returned on GET
This is a manual forward-port of the following change merged into
icehouse branch: https://review.openstack.org/215119

When content of an object is modified from filesystem interface, a GET
on the object will return inconsistent or incomplete content because the
content length originally stored as metadata no longer reflects the
actual length of the file after modification.

The complete fix will have two parts:
(1) Return the entire content of object as is to the client
(2) The Etag returned should reflect the actual md5sum of object content

This change only fixes (1) mentioned above. This means, the client will
always get the complete content of the file.

Fix (2) is not part of this change. This means, if content length of the
object remains same even after modification, the Etag returned would be
incorrect. Fixing (2) involves more invasive changes in the code. So
that is deferred for now and will be sent as a separate change later.

Reference:
https://bugs.launchpad.net/swiftonfile/+bug/1416720
https://review.openstack.org/151897

Change-Id: I28d0ec33c59eb520be7d15a60adb968692226e3e
Closes-Bug: #1416720
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-10-01 15:31:39 +05:30
Prashanth Pai a55740493e Fix object server leaking file descriptors
This is a manual forward-port if the following change in icehouse
branch: https://review.openstack.org/211866

Object server never closes file descriptor when DiskFile.open()
raises an exception. This is fixed by catching exceptions thrown
by code block inside DiskFile.open() and manually closing the
file descriptor.

Change-Id: Ie3e047443f4893e21b9cbdea691867f069363d7e
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-10-01 15:31:39 +05:30
Prashanth Pai 18d039a893 read_metadata() consumers should catch IOError
The xattr module raises IOError which is what the call to
read_metadata() in rmobjdir() should be catching.

Change-Id: I2983ad0be453647f80b862eea93a5fc16fcef04a
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-10-01 15:11:46 +05:30
Thiago da Silva d792d40bd7 fix requirements.txt
restrict pyeclib version to 1.0.7, similar to swift

Change-Id: Ia69b6e1ac82a60d5cca9bbac8bb355124dc75cd6
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-10-01 14:59:16 +05:30
Jenkins 8e3b642a40 Merge "Simplify temp file naming convention" 2015-08-05 21:07:57 +00:00
Prashanth Pai 402f2b4954 Fix building of RPMs
* Update MANIFEST.in
* Update spec file
  - Update dependency to openstack-swift-object 2.3.0
  - Update URL to point to stackforge repo
  - Remove unnecessarry dependencies
  - Remove references to glusterfs
* Make makerpm.sh script executable
* Remove .travis.yml (unrelated)
* Remove legacy Glusterfs.py which is no longer used (unrelated)

Reference spec file from upstream openstack-swift:
http://pkgs.fedoraproject.org/cgit/openstack-swift.git/tree/openstack-swift.spec

Change-Id: I4644fa5b258615e0f8c0b3bdc5287fc169388eb2
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-07-15 12:50:49 +05:30
Prashanth Pai 1a6e22ea88 Simplify temp file naming convention
The intent was (and still is) to devise an unique name for the tempfile.
I can't think of any reason why uuid wouldn't work.

Also, added a comment which has a link to the document explaining why
the specific naming convention is used for temp file name.

Change-Id: I5f0d2b631e276c47c88c554485caaec767703695
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-07-10 01:01:50 +00:00
Jenkins 11b61294c2 Merge "Handle REPLICATE requests gracefully" 2015-07-10 00:17:22 +00:00
Prashanth Pai a39bcbaae2 Remove references to use_put_mount and fs.conf
These are old remnant code that is no longer in use.

Change-Id: Ic0afe1f16884efec49bfa2f64345129e1421daa6
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-07-09 23:58:09 +00:00
Jenkins 4018b3f749 Merge "Rebase to Swift 2.3.0" 2015-07-07 18:37:59 +00:00
Jenkins 780e697e2f Merge "Cleanup exception logging" 2015-07-07 09:54:27 +00:00
Prashanth Pai b145f9b68d Rebase to Swift 2.3.0
This change does the following:

* Update all functional tests, unit tests and conf files based on
  Swift 2.3.0 release.

* Fix "test_versioning_dlo" test from Swift to be SOF compatible.

* Bump swiftonfile release version to 2.3.0

* Update swiftonfile with DiskFile API changes

Change-Id: I75e322724efa4b946007b6d2786d92f73d5ae313
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-07-06 15:22:10 +05:30
Zandrr 63589a98aa Fix incomplete example command in quick start guide
Change-Id: Ic55d1f62ab2ee783aece5a5850feb90123335bdb
2015-06-16 13:21:19 +00:00
Bill Owen 0d11589042 Cleanup exception logging
Add IOERROR.strerror to exception messages in utils.py
Correct some types in exception messages in fs_utils.py

Change-Id: Iac81860b08daf8cdbb7f8e8950f4ab6104b75bd4
Closes-Bug: #1445237
2015-04-20 05:49:43 -07:00