Merge remote branch 'origin/stable'

Conflicts:
	debian/control
This commit is contained in:
Sage Weil 2011-03-11 14:57:53 -08:00
commit 8218486e47
17 changed files with 50 additions and 16 deletions

View File

@ -6,7 +6,8 @@ SUBDIRS = . src qa man
EXTRA_DIST += \
src/test/run-cli-tests \
src/test/cli \
src/test/downloads
src/test/downloads \
udev/50-rbd.rules
check-local:
# Build gtest before we build our own tests. Doing this instead
# of SUBDIRS because with that, gtest's own tests would be run

8
debian/control vendored
View File

@ -117,7 +117,7 @@ Description: debugging symbols for libcrush1
.
This package contains debugging symbols for libcrush.
Package: libcrush1-dev
Package: libcrush-dev
Architecture: i386 amd64
Section: libdevel
Depends: ${shlibs:Depends}, ${misc:Depends}, libcrush1 (= ${binary:Version})
@ -160,7 +160,7 @@ Description: debugging symbols for librados
.
This package contains debugging symbols for librados.
Package: librados2-dev
Package: librados-dev
Architecture: i386 amd64
Section: libdevel
Depends: ${shlibs:Depends}, ${misc:Depends}, librados2 (= ${binary:Version})
@ -196,7 +196,7 @@ Description: debugging symbols for librbd1
.
This package contains debugging symbols for librbd1.
Package: librbd1-dev
Package: librbd-dev
Architecture: i386 amd64
Section: libdevel
Depends: ${shlibs:Depends}, ${misc:Depends}, librbd1 (= ${binary:Version})
@ -234,7 +234,7 @@ Description: debugging symbols for libceph1
.
This package contains debugging symbols for libceph1.
Package: libceph1-dev
Package: libceph-dev
Architecture: i386 amd64
Section: libdevel
Depends: ${shlibs:Depends}, ${misc:Depends}, libceph1 (= ${binary:Version})

View File

@ -1 +1,3 @@
usr/lib/librbd.so.*
usr/bin/crbdnamer
lib/udev/rules.d/50-rbd.rules

1
debian/rules vendored
View File

@ -41,6 +41,7 @@ install: build
dh_installdirs
$(MAKE) DESTDIR=$(DESTDIR) install
install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
# Add here commands to install the package into debian/testpack.
# Build architecture-independent files here.

View File

@ -9,7 +9,7 @@ CLEANFILES =
bin_PROGRAMS =
sbin_PROGRAMS =
sbin_SCRIPTS =
bin_SCRIPTS = crun cclass $(srcdir)/cclsinfo cdebugpack
bin_SCRIPTS = crun cclass $(srcdir)/cclsinfo cdebugpack crbdnamer
# C/C++ tests to build will be appended to this
check_PROGRAMS =
# tests to actually run on "make check"; if you need extra, non-test,
@ -467,6 +467,7 @@ EXTRA_DIST = $(srcdir)/verify-mds-journal.sh $(srcdir)/vstart.sh $(srcdir)/stop.
$(srcdir)/cclass.in $(srcdir)/cdebugpack.in \
$(srcdir)/cclsinfo $(srcdir)/make_version $(srcdir)/check_version \
$(srcdir)/.git_version \
$(srcdir)/crbdnamer \
$(ceph_tool_gui_DATA)
# work around old versions of automake that don't define $docdir

5
src/crbdnamer Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
echo -n `cat /sys/devices/rbd/$1/pool`
echo -n " "
echo -n `cat /sys/devices/rbd/$1/name`

View File

@ -98,7 +98,7 @@ public:
// cast to double
operator double() {
return (double)sec() + ((double)nsec() / 100000000.0L);
return (double)sec() + ((double)nsec() / 1000000000.0L);
}
operator ceph_timespec() {
ceph_timespec ts;

View File

@ -1990,6 +1990,9 @@ unsigned FileStore::_do_transaction(Transaction& t)
assert(0);
}
if (r == -ENOTEMPTY) {
assert(0 == "ENOTEMPTY suggests garbage data in osd data dir");
}
if (r == -ENOSPC) {
// For now, if we hit _any_ ENOSPC, crash, before we do any damage
// by partially applying transactions.

View File

@ -1144,7 +1144,8 @@ void OSD::project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from,
<< ", start " << h
<< dendl;
for (epoch_t e = osdmap->get_epoch();
epoch_t e;
for (e = osdmap->get_epoch();
e > from;
e--) {
// verify during intermediate epoch (e-1)
@ -1177,6 +1178,17 @@ void OSD::project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from,
break;
}
// base case: these floors should be the creation epoch if we didn't
// find any changes.
if (e == h.epoch_created) {
if (!h.same_acting_since)
h.same_acting_since = e;
if (!h.same_up_since)
h.same_up_since = e;
if (!h.same_primary_since)
h.same_primary_since = e;
}
dout(15) << "project_pg_history end " << h << dendl;
}
@ -3894,6 +3906,8 @@ void OSD::handle_pg_create(MOSDPGCreate *m)
// figure history
PG::Info::History history;
history.epoch_created = created;
history.last_epoch_clean = created;
project_pg_history(pgid, history, created, up, acting);
// register.

View File

@ -351,7 +351,9 @@ void PG::merge_log(ObjectStore::Transaction& t,
if (p->version <= log.head) {
dout(10) << "merge_log split point is " << *p << dendl;
if (p->version == log.head)
hash_map<sobject_t,Log::Entry*>::const_iterator oldobj = old_objects.find(p->soid);
if (oldobj != old_objects.end() &&
oldobj->second->version == p->version)
p++; // move past the split point, if it also exists in our old log...
break;
}
@ -843,7 +845,7 @@ void PG::generate_past_intervals()
}
epoch_t first_epoch = 0;
epoch_t stop = MAX(1, info.history.last_epoch_clean);
epoch_t stop = MAX(info.history.epoch_created, info.history.last_epoch_clean);
epoch_t last_epoch = info.history.same_acting_since - 1;
dout(10) << __func__ << " over epochs " << stop << "-" << last_epoch << dendl;
@ -1632,8 +1634,11 @@ void PG::do_peer(ObjectStore::Transaction& t, list<Context*>& tfin,
if (pi.is_empty())
continue;
if (peer_missing.find(peer) == peer_missing.end()) {
if (pi.last_update == pi.last_complete) {
dout(10) << " infering no missing (last_update==last_complete) for osd" << peer << dendl;
if (pi.last_update == pi.last_complete && // peer has no missing
pi.last_update == info.last_update) { // peer is up to date
// replica has no missing and identical log as us. no need to
// pull anything.
dout(10) << " infering up to date and no missing (last_update==last_complete) for osd" << peer << dendl;
peer_missing[peer].num_missing(); // just create the entry.
search_for_missing(peer_info[peer], &peer_missing[peer], peer);
continue;
@ -3723,9 +3728,9 @@ void PG::Missing::add(const sobject_t& oid, eversion_t need, eversion_t have)
rmissing[need] = oid;
}
void PG::Missing::rm(const sobject_t& oid, eversion_t when)
void PG::Missing::rm(const sobject_t& oid, eversion_t v)
{
if (missing.count(oid) && missing[oid].need < when) {
if (missing.count(oid) && missing[oid].need <= v) {
rmissing.erase(missing[oid].need);
missing.erase(oid);
}

View File

@ -586,7 +586,7 @@ public:
void add_event(Log::Entry& e);
void revise_need(sobject_t oid, eversion_t need);
void add(const sobject_t& oid, eversion_t need, eversion_t have);
void rm(const sobject_t& oid, eversion_t when);
void rm(const sobject_t& oid, eversion_t v);
void got(const sobject_t& oid, eversion_t v);
void got(const std::map<sobject_t, Missing::item>::iterator &m);

View File

@ -107,7 +107,8 @@ void Filer::_probe(Probe *probe)
p++) {
dout(10) << "_probe probing " << p->oid << dendl;
C_Probe *c = new C_Probe(this, probe, p->oid);
probe->ops[p->oid] = objecter->stat(p->oid, p->oloc, probe->snapid, &c->size, &c->mtime, probe->flags, c);
probe->ops[p->oid] = objecter->stat(p->oid, p->oloc, probe->snapid, &c->size, &c->mtime,
probe->flags | CEPH_OSD_FLAG_WRITE, c);
}
}

1
udev/50-rbd.rules Normal file
View File

@ -0,0 +1 @@
KERNEL=="rbd[0-9]*", PROGRAM="/usr/bin/crbdnamer %n", SYMLINK+="rbd/%c{1}/%c{2}:%n"