1070 Commits

Author SHA1 Message Date
Kazuhiro MIYAHARA
443f029a58 Enable to configure object-expirer in object-server.conf
To prepare for object-expirer's general task queue feature [1],
this patch enables to configure object-expirer in object-server.conf.
Object-expirer.conf can be used in the same manner as before, but deprecated.

If both of object-server.conf with "object-expirer" section and
object-expirer.conf are in a node, only object-server.conf is used.
Object-expirer.conf is used only if all object-server.conf doesn't have
"object-expirer" section.

There are two differences between "object-expirer.conf" style and
"object-server.conf" style.

The first difference is `dequeue_from_legacy` default value.
`dequeue_from_legacy` defines task queue mode. In "object-expirer.conf"
style, the default mode is legacy queue. In "object-server.conf" style,
the default mode is general queue. But general mode means no-op mode
for now, because general task queue is not implemented yet.

The second difference is internal client config. In "object-expirer.conf"
style, config file of internal client is the object-expirer.conf itself.
In "object-server.conf" style, config file of internal client is
another file.

[1]: https://review.openstack.org/#/c/517389/

Co-Authored-By: Matthew Oliver <matt@oliver.net.au>

Change-Id: Ib21568f9b9d8547da87a99d65ae73a550e9c3230
2019-05-04 15:45:02 +00:00
Zuul
8585c8742e Merge "Make log format for requests configurable" 2019-05-03 21:08:43 +00:00
Gilles Biannic
a4cc353375 Make log format for requests configurable
Add the log_msg_template option in proxy-server.conf and log_format in
a/c/o-server.conf. It is a string parsable by Python's format()
function. Some fields containing user data might be anonymized by using
log_anonymization_method and log_anonymization_salt.

Change-Id: I29e30ef45fe3f8a026e7897127ffae08a6a80cd9
2019-05-02 17:43:25 -06:00
ZhongShengping
32bf43990c Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: I5e77307de6a484fd69b2a5863423ceb357e8601f
2019-04-24 09:56:54 +08:00
Pete Zaitcev
52bc11f097 Use labels to mount filesystems in the guide
It was a recommended practice for years to get away from straight
names in /dev, like /dev/sda1, when mounting filesystems. The
man page for mount(8) says:

   The device name of disk partitions are unstable; hardware
   reconfiguration, adding or removing a device can cause change
   in names. This is reason why it's strongly recommended to use
   filesystem or partition identificators like UUID or LABEL.

Nonetheless, novice operators sometimes follow our deployment
guide to the letter and then get into trouble when device names
shift from under their deployments. This patch fixes the problem
without bloating up the guide with general explanations.

Change-Id: I5faae158b62e0395d6e774cd67bd868c785c2186
2019-04-02 22:45:27 -05:00
Tim Burke
d185b607bb docs: clean up SAIO formatting
Drive-by: use six.moves in s3api; fix "unexpected indent" warning when building
docs on py3

Change-Id: I2a354e2624c763a68fcea7a6404e9c2fde30d631
2019-03-04 17:37:12 -08:00
Alexandra Settle
693f931a59 Fixing target for cross-ref 'get_data_dir'
At the moment, the `get_data_dir` ref in [0] is not
pointing to anything. This patch amends that and
links it to the correct policy string.

Without updating this change, local tox builds
for swift documentation fail with the following
error: Warning, treated as error: /home/asettle/openstack/swift/doc
/source/overview_policies.rst:555:more than one target found for
cross-reference u'get_data_dir': swift.obj.reconstructor.get_data_dir,
swift.obj.diskfile.get_data_dir, swift.obj.replicator.get_data_dir

[0] https://docs.openstack.org/swift/rocky/overview_policies.html#object-server

Change-Id: I7c699e4fc46706a4971fce5a85ed335f471d3a2b
2019-02-13 17:47:50 +00:00
Matthew Oliver
34aef9d091 Add chaging secret key for external KMS section
This patch updates the overview_encryption page to add a
`Changing the encryption root secret of external KMS's` section
to point out the slight difference in naming. I.E:

  key_id_<secret_id> vs. encryption_root_secret_<secret_id>

This patch refers to both multikey support in the KMIP and KMS
key masters, so really should land after both of them.

Related-Change-Id: Ie52508e47d15ec5c4e96902d3c9f5f282d275683
Related-Change-Id: I4f485dcb31e5bea511c4e539c54681091fc5bb1c
Change-Id: Ie4cd8ae038501c8abc43d09cf0b207ca375a4366
2018-11-26 21:38:56 -08:00
Tim Burke
887ba87c5a Add "historical document" note to ring background docs
Change-Id: Ib00193b62c1f35b06a93f261bd6cb0d2f9167b86
2018-11-02 17:21:19 +00:00
John Dickinson
11e81cfc8f added note about double url quoting
Change-Id: I196fc4212b5405c410c9bfb850cd0d4737094c47
2018-10-31 11:41:37 -07:00
Clay Gerrard
06cf5d298f Add databases_per_second to db daemons
Most daemons have a "go as fast as you can then sleep for 30 seconds"
strategy towards resource utilization; the object-updater and
object-auditor however have some "X_per_second" options that allow
operators much better control over how they spend their I/O budget.

This change extends that pattern into the account-replicator,
container-replicator, and container-sharder which have been known to peg
CPUs when they're not IO limited.

Partial-Bug: #1784753
Change-Id: Ib7f2497794fa2f384a1a6ab500b657c624426384
2018-10-30 22:28:05 +00:00
zhulingjie
83a7ce8ce0 Python 3 compatibility: fix xrange/range issues
xrange is not defined in python3.
Rename xrange() to range().

Change-Id: Ifb1c9cfd863ce6dfe3cced3eca7ea8e539d8a5e9
2018-10-14 14:08:19 +00:00
Zuul
9bf1360f88 Merge "Replacing six.iter/dict.iter usages" 2018-09-27 08:43:30 +00:00
Zuul
0918ff2136 Merge "update 1space url in associated projects" 2018-09-27 02:00:03 +00:00
Zuul
5cc4a72c76 Merge "Configure diskfile per storage policy" 2018-09-27 00:19:32 +00:00
Thiago da Silva
36a3fee805 update 1space url in associated projects
Change-Id: Idcb1e9cacba5b959387a2bfd7a4ef5e9d502996a
2018-09-26 11:55:38 -04:00
Alistair Coles
904e7c97f1 Add more doc and test for cors_expose_headers option
In follow-up to the related change, mention the new
cors_expose_headers option (and other proxy-server.conf
options) in the CORS doc.

Add a test for the cors options being loaded into the
proxy server.

Improve CORS comments in docs.

Change-Id: I647d8f9e9cbd98de05443638628414b1e87d1a76
Related-Change: I5ca90a052f27c98a514a96ee2299bfa1b6d46334
2018-09-17 12:35:25 -07:00
zhangdebo
a7dd5f655d Replace Chinese quotes with English quotes
Change-Id: Ic7025ba79eadb39f75dd03135fae3326138b3ded
2018-09-15 03:20:24 -04:00
FatemaKhalid
cfeb32c66b Adding keep_idle config value to socket
User can cofigure KEEPIDLE time for sockets in TCP connection.
The default value is the old value which is 600.

Change-Id: Ib7fb166deb8a87ae4e97ba0671048b1ec079a2ef
Closes-Bug:1759606
2018-09-15 01:30:53 +02:00
John Dickinson
ebcc95a96b added some bootstrapping info to the top of the SAIO doc
Change-Id: Ib82f2494f2cc65a3f15925efe0dfeb52eb7aa22b
2018-09-12 17:12:36 -06:00
John Dickinson
77734bccd2 Disable the docs badge saying the docs aren't accurate
Change-Id: I1337712cc790baca151db2575f650da243bf09ef
2018-09-11 11:53:33 -06:00
Romain LE DISEZ
673fda7620 Configure diskfile per storage policy
With this commit, each storage policy can define the diskfile to use to
access objects. Selection of the diskfile is done in swift.conf.

Example:
    [storage-policy:0]
    name = gold
    policy_type = replication
    default = yes
    diskfile = egg:swift#replication.fs

The diskfile configuration item accepts the same format than middlewares
declaration: [[scheme:]egg_name#]entry_point
The egg_name is optional and default to "swift". The scheme is optional
and default to the only valid value "egg". The upstream entry points are
"replication.fs" and "erasure_coding.fs".

Co-Authored-By: Alexandre Lécuyer <alexandre.lecuyer@corp.ovh.com>
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I070c21bc1eaf1c71ac0652cec9e813cadcc14851
2018-08-24 02:29:13 +00:00
Tim Burke
e547448e96 Fix warning while building docs
Seen locally:

    Warning, treated as error:
    .../swift/doc/source/overview_policies.rst:555:more than one target
    found for cross-reference u'get_data_dir':
    swift.obj.reconstructor.get_data_dir, swift.obj.replicator.get_data_dir,
    swift.obj.diskfile.get_data_dir

Not sure why it hasn't been seen in the gate...

The whole sentence is suspect, though; the Diskfile class doesn't define
a get_data_dir method, though it uses the module-level get_data_dir...

Change-Id: I6855c82315e1c71596ecce25b66b54133c239377
2018-08-23 11:15:24 -07:00
Alistair Coles
2722e49a8c Add support for multiple root encryption secrets
For some use cases operators would like to periodically introduce a
new encryption root secret that would be used when new object data is
written. However, existing encrypted data does not need to be
re-encrypted with keys derived from the new root secret. Older root
secret(s) would still be used as necessary to decrypt older object
data.

This patch modifies the KeyMaster class to support multiple root
secrets indexed via unique secret_id's, and to store the id of the
root secret used for an encryption operation in the crypto meta. The
decrypter is modified to fetch appropriate keys based on the secret id
in retrieved crypto meta.

The changes are backwards compatible with previous crypto middleware
configurations and existing encrypted object data.

Change-Id: I40307acf39b6c1cc9921f711a8da55d03924d232
2018-08-17 17:54:30 +00:00
John Dickinson
86d78f6667 imported some docs from the old user-guide
These files are imported (and very lightly edited) from the old
ocata user-guide. It has a few other swift-related docs that seemed
more duplacative of what we already have, but these seem to fill
existing gaps in our docs.

Change-Id: Ib00bf6992327f15f271120dc5dbc86a4a235baec
2018-08-01 15:17:42 -07:00
Zuul
00373dad61 Merge "Add keymaster to fetch root secret from KMIP service" 2018-07-25 03:49:50 +00:00
Zuul
89854250c3 Merge "Add fallocate_reserve to account and container servers." 2018-07-20 08:42:51 +00:00
Samuel Merritt
8e651a2d3d Add fallocate_reserve to account and container servers.
The object server can be configured to leave a certain amount of disk
space free; default is 1%. This is useful in avoiding 100%-full
filesystems, as those can get Swift in a state where the filesystem is
too full to write tombstones, so you can't delete objects to free up
space.

When a cluster has accounts/containers and objects on the same disks,
then you can wind up with a 100%-full disk since account and container
servers don't respect fallocate_reserve. This commit makes account and
container servers respect fallocate_reserve so that disks shared
between account/container and object rings won't get 100% full.

When a disk's free space falls below the configured reserve, account
and container PUT, POST, and REPLICATE requests will fail with a 507
status code. These are the operations that can significantly increase
the disk space used by a given database.

I called the parameter "fallocate_reserve" for consistency with the
object server. No actual fallocate() call happens under Swift's
control in the account or container servers (sqlite3 might make such a
call, but it's out of our hands).

Change-Id: I083442eef14bf83c0ea717b1decb3e6b56dbf1d0
2018-07-18 17:27:11 +10:00
Nguyen Hai
4409da697f Update doc building instructions in Development Guidelines
Change-Id: Ifd2f468ad745d19ef474ae7503a8bd79d429fc1b
2018-07-06 07:40:52 +00:00
Alistair Coles
1951dc7e9a Add keymaster to fetch root secret from KMIP service
Add a new middleware that can be used to fetch an encryption root
secret from a KMIP service. The middleware uses a PyKMIP client
to interact with a KMIP endpoint. The middleware is configured with
a unique identifier for the key to be fetched and options required
for the PyKMIP client.

Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Change-Id: Ib0943fb934b347060fc66c091673a33bcfac0a6d
2018-07-03 09:00:21 +01:00
Alistair Coles
600521cf57 Describe separate keymaster config file in docs
The use of a separate keymaster config file was previously only
described in the context of the kms_keymaster middleware. This patch
adds a section to the simple keymaster middleware docs.

Change-Id: Ifa3ad9d6e892b81c52df1f6666a9881042ac60bd
2018-06-28 12:57:57 +01:00
lvxianguo
f0e46857b7 fix misspelling of 'server'
Change-Id: I61f916d5734708a821c8d51961fc2d222967f6e8
2018-06-22 18:32:28 +08:00
Alistair Coles
554c07aa5f Fix the example webhook middleware
Change-Id: I242dc8bc655a1d1243c2d4bd51fc62e4dcadc67b
2018-06-20 10:49:30 +01:00
Zuul
a3cc7ccc69 Merge "Experimental swift-ring-composer CLI to build composite rings" 2018-06-15 04:27:43 +00:00
Zuul
ea33638d0c Merge "object-updater: add concurrent updates" 2018-06-14 20:37:06 +00:00
Alistair Coles
6b626f2f98 Experimental swift-ring-composer CLI to build composite rings
Provides a simple, experimental, CLI tool to generate a
composite ring from a list of component builder files.

For example:

  swift-ring-composer <composite-file> compose \
      <builder-file> <builder-file> --output <ring-file>

Commands available:

- compose: compose a list of builder file to a composite ring
- show: show the metadata for a composite ring

Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>
Change-Id: I25a79e71c13af352e19e4358f60545265b51584f
2018-06-14 09:50:55 +01:00
Samuel Merritt
d5c532a94e object-updater: add concurrent updates
The object updater now supports two configuration settings:
"concurrency" and "updater_workers". The latter controls how many
worker processes are spawned, while the former controls how many
concurrent container updates are performed by each worker
process. This should speed the processing of async_pendings.

There is a change to the semantics of the configuration
options. Previously, "concurrency" controlled the number of worker
processes spawned, and "updater_workers" did not exist. I switched the
meanings for consistency with other configuration options. In the
object reconstructor, object replicator, object server, object
expirer, container replicator, container server, account replicator,
account server, and account reaper, "concurrency" refers to the number
of concurrent tasks performed within one process (for reference, the
container updater and object auditor use "concurrency" to mean number
of processes).

On upgrade, a node configured with concurrency=N will still handle
async updates N-at-a-time, but will do so using only one process
instead of N.

UpgradeImpact:

If you have a config file like this:

    [object-updater]
    concurrency = <N>

and you want to take advantage of faster updates, then do this:

    [object-updater]
    concurrency = 8  # the default; you can omit this line
    updater_workers = <N>

If you want updates to be processed exactly as before, do this:

    [object-updater]
    concurrency = 1
    updater_workers = <N>

Change-Id: I17e18088e61f664e1b9942d66423666d0cae1689
2018-06-13 17:39:34 -07:00
Zuul
a42215b14f Merge "Fix typo in sharding docs" 2018-06-13 09:33:29 +00:00
gaofei
f2295a688c Fix typo in sharding docs
This patch removes an additional 'and' added to a sentence.

Change-Id: I6ab47637ef2d2f97f35188a84e741274c2b504e8
2018-06-13 04:44:44 +00:00
Zuul
5a4e193970 Merge "Added S3 compatibility information to docs" 2018-06-13 04:00:10 +00:00
baiwenteng
e726473e26 Fix typos
replace a OpenStack bucket with an OpenStack bucket

Change-Id: I4ada68720dcf23fb9b94c922ddb3eefd42aa80a7
2018-06-11 18:39:48 +08:00
Zuul
c01c43d982 Merge "Adds read_only middleware" 2018-06-07 06:49:26 +00:00
John Dickinson
5078bb1254 Added S3 compatibility information to docs
Change-Id: I8a179e2e9dea1dac57a14696bc0abcd48753adfc
2018-05-31 13:19:25 -07:00
Greg Lange
5d601b78f3 Adds read_only middleware
This patch adds a read_only middleware to swift. It gives the ability
to make an entire cluster or individual accounts read only.
When a cluster or an account is in read only mode, requests that would
result in writes to the cluser are not allowed.

DocImpact

Change-Id: I7e0743aecd60b171bbcefcc8b6e1f3fd4cef2478
2018-05-30 03:26:36 +00:00
Thiago da Silva
36dbd38e48 Add s3api headers to allowed_headers by default
Previously, these headers had to be added by operators to their
object-server.conf when enabling swift3 middleware. Since s3api
is now imported into swift we should go ahead and add these headers
by default too.

Change-Id: Ib82e175096716e42aecdab48f01f079e09da6a1d
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2018-05-29 16:02:50 -04:00
zhangdebo
3d3393c17a Fix typo
Change-Id: I25bdb2020c10f4b3aede6994e9ffc3f05a054c29
2018-05-23 10:34:16 +08:00
Alistair Coles
99023ef855 Maintain manage-shard-ranges docs in its module
Move the doc for manage-shard-ranges to the manage_shard_ranges.py module
and include it in overview_container_sharding.rst. This makes the doc for
manage-shard-ranges more obvious when viewing the code.

Change-Id: I27ca9b59897c5256dd5e2c3d4e26ff9e762b4a81
2018-05-22 05:20:14 +09:00
Alistair Coles
4c559fccb7 Container sharding doc fixes and clarifications
Change-Id: I1e736c8da142adecc2b0b629cfd48afa072d40a0
2018-05-21 11:58:18 +01:00
Alistair Coles
ea92e49980 Merge container sharding into master
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: John Dickinson <me@not.mn>
Co-Authored-By: Kazuhiro MIYAHARA <miyahara.kazuhiro@lab.ntt.co.jp>
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>
Co-Authored-By: Samuel Merritt <sam@swiftstack.com>
Co-Authored-By: Tim Burke <tim.burke@gmail.com>

Change-Id: I964666d2c1ce893326c6aa2bbe9e1dd0312e7a9e
2018-05-18 18:30:19 -07:00
Alistair Coles
5c5b08d047 Add container sharding documentation
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>
Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: John Dickinson <me@not.mn>

Change-Id: I0693e54c1d7f3b77f53c3df5c616a16f74723b97
2018-05-18 18:48:22 +01:00