Otherwise, you can get a recovery op in the queue which has a cost
higher than the max token value. It won't get serviced until all other
queues also do not have enough tokens and higher priority queues are
empty.
Fixes: #7706
Signed-off-by: Samuel Just <sam.just@inktank.com>
Fixes: 7703
Object can be copied between different buckets, so we need to keep track
of which bucket is used for naming the tail parts. The new manifest
requires that because older manifest just held all the tail objects
(each containing the appropriate bucket internally).
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rbd_fuse/rbd-fuse.c: In function 'enumerate_images':
rbd_fuse/rbd-fuse.c:113:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Signed-off-by: Sage Weil <sage@inktank.com>
CID 1188167 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member "export_dir" is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1188166 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member "state" is not initialized in this
constructor nor in any functions that it calls.
4. uninit_member: Non-static class member "peer" is not initialized in this
constructor nor in any functions that it calls.
6. uninit_member: Non-static class member "tid" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1188165 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member "state" is not initialized in
this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member "peer" is not initialized in this
constructor nor in any functions that it calls.
6. uninit_member: Non-static class member "tid" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 966632 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
2. fixed_size_dest: You might overrun the 200 byte fixed-size string
"path" by copying "args[0UL]" without checking the length.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This isn't in test/crypto.cc because common_init_finish is called prior
to running any tests. Will not build the test function if Ceph hasn't
been configured with NSS.
Signed-off-by: Sharif Olorin <sio@tesser.org>
This change prevents a segfault in ceph::crypto::init when using NSS and
calling rados_connect from multiple threads simultaneously on different
rados_t objects (and updates the documentation for rados_connect to
reflect the fix).
It's pretty simple, just one static mutex wrapping the
NSS definition of ceph::crypto::init. More details regarding the race
condition are in this[0] commit (and pull request #1424).
To reproduce the race condition in the existing codebase, the below[1]
C program will work (depending on number of cores and probably other
things, the number of threads needed to reliably reproduce varies, but
the more the better - in my environment five is sufficient, with four
cores.
[0]: 377c919088
[1]:
```c
void *init(void *p) {
int err;
rados_t cluster;
err = rados_create(&cluster, NULL);
if (err < 0) {
fprintf(stderr, "cannot create cluster handle: %s\n", strerror(-err));
return NULL;
}
err = rados_conf_read_file(cluster, "./ceph.conf");
if (err < 0) {
fprintf(stderr, "error reading config file: %s\n", strerror(-err));
return NULL;
}
rados_connect(cluster);
return NULL;
}
int main() {
pthread_t ts[NTHREAD];
int i;
for (i = 0; i < NTHREAD; i++) {
pthread_create(&ts[i], NULL, init, NULL);
}
for (i = 0; i < NTHREAD; i++) {
int k;
void *p = (void*)&k;
pthread_join(ts[i], p);
}
return 0;
}
```
Signed-off-by: Sharif Olorin <sio@tesser.org>
1. We are trying to create the PG folder up to several levels with a standalone tool to prevent it from runtime splitting, we need a configuration which prevent it from merging even there is no file within the folder.
2. As runtime split / merge could bring latency issues, customer can use a negative merge threshold to prevent merging but only splitting.
This change is backward compatbile.
Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
Previous commit (047287afbe) broke
formatting on the formula, and also made mixed formula and text oddly,
which on second thought didn't look too good.
Add the note about the power of two to the following paragraph
instead, in prose.
Signed-off-by: Florian Haas <florian@hastexo.com>
CID 966624 (#5 of 5): Resource leak (RESOURCE_LEAK)
17. leaked_storage: Variable "cmount" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 743410 (#17 of 17): Resource leak (RESOURCE_LEAK)
65. leaked_storage: Variable "cmount" going out of scope leaks the storage
it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1054877 (#1 of 1): Missing varargs init or cleanup (VARARGS)
17. missing_va_end: va_end was not called for "ap".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717377 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member "max_uploads" is not initialized
in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member "default_max" is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717223 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member "m_snap_seq" is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
We clearly won't get dup ops on these repops, and they don't
have meaningful versions since they don't carry log
entries.
Fixes: #7682
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717212 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member "m_getdescs_hook" is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1063697 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
5. var_deref_model: Passing null pointer "data" to function
"RGWXMLParser::parse(char const *, int, int)", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ID 1019554 (#1 of 1): Dereference after null check (FORWARD_NULL)
13. var_deref_model: Passing null pointer "straydn" to function
"MDSCacheObject::is_auth() const", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Following an IRC discussion, it emerged that it would be helpful
to explain the merit of choosing a number of PGs per pool that is
a power of two, to keep PGs at roughly equal sizes in case of
PG splits.
See http://irclogs.ceph.widodh.nl/index.php?date=2014-03-12 for the
original discussion.
Signed-off-by: Florian Haas <florian@hastexo.com>
CID 1191886 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 34) is not terminated by a 'break'
statement.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This should reduce the sting of the previous commit somewhat. We wait
for the activation transactions to clear prior to accepting IO anyway,
so we can go ahead and get that process started without waiting for the
flush.
Signed-off-by: Samuel Just <sam.just@inktank.com>
There are two problems:
1) We choose the min last_update amoung peers with the max local-les
value as an upper bound on requests which could have been reported to
the client as committed. We then, for ec pools, roll back to that point
to ensure that we don't inadvertently commit to an update which fewer
than K replicas actually saw. If the primary sets local-les, accepts an
update from a client, and there is a new interval before any of the
replicas have been activated, we will end up being forced to use that
update which no other replica has seen as the new last_update. This
will cause the object to become unfound. We don't have this problem as
long as all active replicas agree on last_update before we accept IO.
2) Even for replicated pools, we would then immediately respond to the
request which created the primary-only update with a commit since it is
in the log and we have no outstanding repops. If we then lose that
primary before any of the replicas in the new interval record the new
log, we will not only lose the object, but also the log entry recording
it, which will result in a lost write.
For these reasons, it seems like we need to wait for the replicas to
activate before we can process new requests essentially because whatever
update we select as last_update is essentially regarded as committed as
soon as we accept IO.
Fixes: #7649
Signed-off-by: Samuel Just <sam.just@inktank.com>
The older versions of ceph-common (ceph CLI, in particular) can't talk to
newer clusters. The primary change happened with dumpling when the new
CLI and rest-api changes were made. Although in reality ceph doesn't
care what version of ceph-common is installed, in practice this forces
ceph-common to get upgraded along with ceph and avoids some user pain.
Fixes: #7641
Signed-off-by: Sage Weil <sage@inktank.com>