Skip to content

Swift V1: support object versioning#2571

Merged
mandre merged 1 commit intogophercloud:masterfrom
kayrus:swift-versioning
Feb 28, 2023
Merged

Swift V1: support object versioning#2571
mandre merged 1 commit intogophercloud:masterfrom
kayrus:swift-versioning

Conversation

@kayrus
Copy link
Copy Markdown
Contributor

@kayrus kayrus commented Feb 24, 2023

Fixes #2181

I focused on functional tests for objects versioning checks, since it requires a lot of duplicate checks in objects unit tests. Hope this is fine.

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 24, 2023

Coverage Status

Coverage: 80.234% (+0.1%) from 80.093% when pulling ebf9f9c on kayrus:swift-versioning into e7de1a3 on gophercloud:master.

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 24, 2023

@EmilienM looks like versioning is not supported in testing env. Can you run functional tests in your env? I'll probably skip the tests.

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 27, 2023

@mandre @pierreprinetti could you please review this PR?

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

@mandre @pierreprinetti could you please review this PR?

Thanks for the PR, will look today or tomorrow.

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

@EmilienM looks like versioning is not supported in testing env. Can you run functional tests in your env? I'll probably skip the tests.

This is odd, the CI environment should enable the object versioning. The CI logs read:

iniset /etc/swift/proxy-server.conf filter:versioned_writes allow_versioned_writes true

What was the issue exactly?

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 27, 2023

This is odd, the CI environment should enable the object versioning.

these are two legacy implementations of the object versioning. See https://docs.openstack.org/swift/latest/middleware.html#module-swift.common.middleware.versioned_writes.object_versioning for details.

To enable this new mode in a Swift cluster the versioned_writes and symlink middlewares must be added to the proxy pipeline, you must also set the option allow_object_versioning to True

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 27, 2023

@mandre I don't understand, is it enabled in test env?

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

@mandre I don't understand, is it enabled in test env?

Not at the moment, I'm trying to see how we could enable it in our CI.

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

@kayrus Try to add the following to the conf_overrides for swift job and see if it makes a difference:

[[post-config|$SWIFT_CONFIG_PROXY_SERVER]]                                                                                                                  
[filter:versioned_writes]
allow_object_versioning = True

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 27, 2023

Done, let's see the results...

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 27, 2023

Still doesn't work

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

I'm building a devstack environment to test myself. Worst case, we'll merge with the acceptance test skipped like you did originally and try to get the env ready to run it as a follow-up.

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Feb 27, 2023

I was able to run the tests successfully with a local devstack I deployed using the same snippet so I'm fairly confident this works on master. I'll look at the patch in more details tomorrow.

For the record, here's the local.conf I used:

[[local|localrc]]
ADMIN_PASSWORD=password
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
USE_PYTHON3=True
INSTALL_TEMPEST=False
SWIFT_HASH=1234123412341234
SWIFT_ENABLE_TEMPURLS=True
SWIFT_TEMPURL_KEY=secretkey
ENABLED_SERVICES+=",-horizon,-dstat,-tempest,s-account,s-container,s-object,s-proxy"
[[post-config|$SWIFT_CONFIG_PROXY_SERVER]]
[filter:versioned_writes]
allow_object_versioning = true

Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very nice work. Let's just add a skip for the test like you did before, and we'll iterate on the CI environment in a separate patch.

@kayrus
Copy link
Copy Markdown
Contributor Author

kayrus commented Feb 28, 2023

I skip the tests.

@mandre mandre added this to the v1.3.0 milestone Feb 28, 2023
Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mandre mandre merged commit 95364c2 into gophercloud:master Feb 28, 2023
@kayrus kayrus deleted the swift-versioning branch February 28, 2023 14:36
mandre added a commit to shiftstack/gophercloud that referenced this pull request Feb 28, 2023
The devstack environment was not setup properly to enable acceptance
tests developed for
gophercloud#2571.
mandre added a commit to shiftstack/gophercloud that referenced this pull request Feb 28, 2023
The devstack environment was not setup properly to enable acceptance
tests developed for
gophercloud#2571.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does gophercloud support Object Versioning API?

3 participants