Add old_inodes to emetablob
PATCH 1/1 Add old_inodes to emetablob
This was supposed to fix bug 1946, and likely bug 1849 too, but it looks like something's still missing for a complete fix. fuse-unmounting between touching a dir and creating a snapshot seems to help get correct snapshot timestamp, but touching the dir after remounting and restarting the mds shortly afterwards very often results in the wrong timestamp for the snapshot.
8<-----
Add information about old inodes to the mds journal.
--- src/mds/events/EMetaBlob.h | 32 +++++++++++++++++++++++++------- src/mds/journal.cc | 2 ++ 2 files changed, 27 insertions(+), 7 deletions(-)
src/mds/events/EMetaBlob.h +25 -7
@@ -68,6 +68,8 @@ public:bufferlist snapbl;bool dirty;struct default_file_layout *dir_layout; + typedef map<snapid_t, old_inode_t> old_inodes_t; +old_inodes_t *old_inodes;bufferlist _enc;
@@ -77,10 +79,11 @@ public: fullbit(const string& d, snapid_t df, snapid_t dl, version_t v, inode_t& i, fragtree_t &dft, map<string,bufferptr> &xa, const string& sym, - bufferlist &sbl, bool dr, default_file_layout *defl = NULL) : + bufferlist &sbl, bool dr, default_file_layout *defl = NULL, + old_inodes_t *oi = NULL) ://dn(d), dnfirst(df), dnlast(dl), dnv(v), //inode(i), dirfragtree(dft), xattrs(xa), symlink(sym), snapbl(sbl), dirty(dr) - dir_layout(NULL), _enc(1024) + dir_layout(NULL), old_inodes(NULL), _enc(1024) { ::encode(d, _enc); ::encode(df, _enc);
@@ -98,15 +101,21 @@ public: ::encode(*defl, _enc); } ::encode(dr, _enc); + ::encode(oi ? true : false, _enc); +if (oi) + ::encode(*oi, _enc); } - fullbit(bufferlist::iterator &p) : dir_layout(NULL) { decode(p); } - fullbit() : dir_layout(NULL) {} + fullbit(bufferlist::iterator &p) : dir_layout(NULL), old_inodes(NULL) { +decode (p); + } + fullbit() : dir_layout(NULL), old_inodes(NULL) {} ~fullbit() { +delete old_inodes;delete dir_layout; } void encode(bufferlist& bl) const { -__u8 struct_v =2 ; +__u8 struct_v =3 ; ::encode(struct_v, bl);assert (_enc.length ()); bl.append (_enc);
@@ -135,6 +144,14 @@ public: } } ::decode(dirty, bl); +if (struct_v >=3 ) { +bool old_inodes_present; + ::decode(old_inodes_present, bl); +if (old_inodes_present) { + old_inodes = new old_inodes_t; + ::decode(*old_inodes, bl); + } + } }void update_inode (MDS *mds,CInode *in);
@@ -562,7 +579,8 @@ private: *pi, in->dirfragtree, *in->get_projected_xattrs (), in->symlink, snapbl, - dirty, default_layout))); + dirty, default_layout, + &in->old_inodes)));if (pi) lump.get_dfull ().back ()->inode = *pi;return &lump.get_dfull ().back ()->inode;
@@ -614,7 +632,7 @@ private:0 , *pi, *pdft, *px, in->symlink, snapbl, - dirty, default_layout); + dirty, default_layout, &in->old_inodes);return &root->inode; }
src/mds/journal.cc +2 -0
@@ -416,6 +416,8 @@ void EMetaBlob::fullbit::update_inode(MDS *mds, CInode *in) } else if (in->inode.is_symlink()) { in->symlink = symlink; } + if (old_inodes) + in->old_inodes = *old_inodes; } void EMetaBlob::replay(MDS *mds, LogSegment *logseg)
Signature · 7 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer
Sage Weil
AppliedApplied, with a small cleanup (wip-mds-old-inodes).. I'll merge it in tomorrow after a bit of testing.
Quoted 4 lines · Alexandre Oliva
This was supposed to fix bug 1946, and likely bug 1849 too, but it looks like something's still missing for a complete fix. fuse-unmounting between touching a dir and creating a snapshot seems to help get correct snapshot timestamp,
Hmm, that sounds like ceph-fuse isn't sending the write flushsnap cap message. I forget.. have you tried the same with the kernel client?
Quoted 3 lines
but touching the dir after remounting and restarting
the mds shortly afterwards very often results in the wrong timestamp for the snapshot.
Do you 'sync' after the touch, by any chance? It may be lost between the client and mds, not in the MDS journal. A full mds log of this should have the answer.
Thanks for digging into this!
sage
Quoted 124 lines
8<-----
Add information about old inodes to the mds journal.
Signed-off-by Alexandre Oliva <[email protected]>--- src/mds/events/EMetaBlob.h | 32 +++++++++++++++++++++++++------- src/mds/journal.cc | 2 ++ 2 files changed, 27 insertions(+), 7 deletions(-)src/mds/events/EMetaBlob.h +25
-7@@ -68,6 +68,8 @@ public:bufferlist snapbl;bool dirty;struct default_file_layout *dir_layout; + typedef map<snapid_t, old_inode_t> old_inodes_t; +old_inodes_t *old_inodes;bufferlist _enc;@@ -77,10 +79,11 @@ public: fullbit(const string& d, snapid_t df, snapid_t dl, version_t v, inode_t& i, fragtree_t &dft, map<string,bufferptr> &xa, const string& sym, - bufferlist &sbl, bool dr, default_file_layout *defl = NULL) : + bufferlist &sbl, bool dr, default_file_layout *defl = NULL, + old_inodes_t *oi = NULL) ://dn(d), dnfirst(df), dnlast(dl), dnv(v), //inode(i), dirfragtree(dft), xattrs(xa), symlink(sym), snapbl(sbl), dirty(dr) - dir_layout(NULL), _enc(1024) + dir_layout(NULL), old_inodes(NULL), _enc(1024) { ::encode(d, _enc); ::encode(df, _enc);@@ -98,15 +101,21 @@ public: ::encode(*defl, _enc); } ::encode(dr, _enc); + ::encode(oi ? true : false, _enc); +if (oi) + ::encode(*oi, _enc); } - fullbit(bufferlist::iterator &p) : dir_layout(NULL) { decode(p); } - fullbit() : dir_layout(NULL) {} + fullbit(bufferlist::iterator &p) : dir_layout(NULL), old_inodes(NULL) { +decode (p); + } + fullbit() : dir_layout(NULL), old_inodes(NULL) {} ~fullbit() { +delete old_inodes;delete dir_layout; } void encode(bufferlist& bl) const { -__u8 struct_v =2 ; +__u8 struct_v =3 ; ::encode(struct_v, bl);assert (_enc.length ()); bl.append (_enc);@@ -135,6 +144,14 @@ public: } } ::decode(dirty, bl); +if (struct_v >=3 ) { +bool old_inodes_present; + ::decode(old_inodes_present, bl); +if (old_inodes_present) { + old_inodes = new old_inodes_t; + ::decode(*old_inodes, bl); + } + } }void update_inode (MDS *mds,CInode *in);@@ -562,7 +579,8 @@ private: *pi, in->dirfragtree, *in->get_projected_xattrs (), in->symlink, snapbl, - dirty, default_layout))); + dirty, default_layout, + &in->old_inodes)));if (pi) lump.get_dfull ().back ()->inode = *pi;return &lump.get_dfull ().back ()->inode;@@ -614,7 +632,7 @@ private:0 , *pi, *pdft, *px, in->symlink, snapbl, - dirty, default_layout); + dirty, default_layout, &in->old_inodes);return &root->inode; }src/mds/journal.cc +2
-0@@ -416,6 +416,8 @@ void EMetaBlob::fullbit::update_inode(MDS *mds, CInode *in) } else if (in->inode.is_symlink()) { in->symlink = symlink; } + if (old_inodes) + in->old_inodes = *old_inodes; } void EMetaBlob::replay(MDS *mds, LogSegment *logseg)Signature · 11 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Sage Weil
Quoted 4 lines · Alexandre Oliva
This was supposed to fix bug 1946, and likely bug 1849 too, but it looks like something's still missing for a complete fix. fuse-unmounting between touching a dir and creating a snapshot seems to help get correct snapshot timestamp,
Hmm, that sounds like ceph-fuse isn't sending the write flushsnap cap message. I forget.. have you tried the same with the kernel client?
Not recently enough that I'd remember exactly what I did.
However, I don't see how ceph-fuse could be the problem, given today's experiments. Here's what I just did (all with fuse):
create snapshot
check timestamps -> baseline
unmount
mount again
check timestamps -> same
restart mds
check timestamps -> same
unmount
mount again
check timestamps -> same
moved a tree into dir
check timestamps -> dir changed and snapshot unchanged, as expected unmount
mount again
check timestamps -> same
restart mds
check timestamps -> snapshot changed to dir's; its size too!
After each umount, I checked that ceph-fuse was no longer running (it sometimes remains running for a while after umount completes)
I've got full mds logs for this session, but they're kind of huge (860M). Please remind me how to upload them to your server.
Signature · 4 lines
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer
Hi Alexandre,
Quoted 34 lines · Alexandre Oliva
Quoted 8 lines · Sage Weil
Quoted 4 lines · Alexandre Oliva
This was supposed to fix bug 1946, and likely bug 1849 too, but it looks like something's still missing for a complete fix. fuse-unmounting between touching a dir and creating a snapshot seems to help get correct snapshot timestamp,
Hmm, that sounds like ceph-fuse isn't sending the write flushsnap cap message. I forget.. have you tried the same with the kernel client?
Not recently enough that I'd remember exactly what I did.
However, I don't see how ceph-fuse could be the problem, given today's experiments. Here's what I just did (all with fuse):
create snapshot
check timestamps -> baseline
unmount
mount again
check timestamps -> same
restart mds
check timestamps -> same
unmount
mount again
check timestamps -> same
moved a tree into dir
check timestamps -> dir changed and snapshot unchanged, as expected unmount
mount again
check timestamps -> same
restart mds
check timestamps -> snapshot changed to dir's; its size too!
Quoted 2 lines
After each umount, I checked that ceph-fuse was no longer running (it sometimes remains running for a while after umount completes)
It looks like the problem is that CInode::first isn't being journaled. Normally, that's fine because it matches the referring dentry.. but for multiversion inodes (like snapped directories), it won't match. On replay we end up with bad value of 2, and it re-cows and clobbers the original old value.
I pushed wip-1946 with a fix. Want to give it a go? I wasn't able to directly reproduce the behavior you're seeing, but I did see it doing a bad cow_old_inode() and observed that this patch fixes that part.
sage
Quoted 7 lines · Sage Weil
It looks like the problem is that
CInode::firstisn't being journaled. Normally, that's fine because it matches the referring dentry.. but for multiversion inodes (like snapped directories), it won't match. On replay we end up with bad value of 2, and it re-cows and clobbers the original old value.I pushed wip-1946 with a fix. Want to give it a go?
Sorry about the delay, I spent the week facing disk full problems that followed a major crushmap rearrangement and cluster_snaps that I'd rather not remove before the rearrangement was complete. Fun! :-)
I gave it a go, and I'm afraid it doesn't look like it fixed the problem. bb85a7270 (wip-1946^) is the one patch I tested with, because the subsequent patch in wip-1946 failed the assertion during recovery, while replaying AFAICT a directory move. in->first was 2 (the bad value you mention above?).
Observed behavior was still the same: remove old snapshot, touch dir with old timestamp, remount, re-create snapshot, remount, check timestamps in snapshot dir, all fine, restart mds, all fine, touch dir, remount, all fine, restart mds again, snapshot timestamp changes to match.
Signature · 4 lines
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer
Quoted 14 lines · Alexandre Oliva
Quoted 7 lines · Sage Weil
It looks like the problem is that
CInode::firstisn't being journaled. Normally, that's fine because it matches the referring dentry.. but for multiversion inodes (like snapped directories), it won't match. On replay we end up with bad value of 2, and it re-cows and clobbers the original old value.I pushed wip-1946 with a fix. Want to give it a go?
Sorry about the delay, I spent the week facing disk full problems that followed a major crushmap rearrangement and
cluster_snapsthat I'd rather not remove before the rearrangement was complete. Fun! :-)
Quoted 5 lines
I gave it a go, and I'm afraid it doesn't look like it fixed the problem.
bb85a7270(wip-1946^) is the one patch I tested with, because the subsequent patch in wip-1946 failed the assertion during recovery, while replaying AFAICT a directory move.in->firstwas 2 (the bad value you mention above?).
You didn't by chance keep the log?
Anyway, a defensive fix would be to replace that patch's
- in->first = p->dnfirst;
+ assert(in->first == p->dnfirst ||
+ (in->is_multiversion() && in->first > p->dnfirst));
with
if (!in->is_multiversion())
in->first = p->dnfirst;Quoted 5 lines
Observed behavior was still the same: remove old snapshot, touch dir with old timestamp, remount, re-create snapshot, remount, check timestamps in snapshot dir, all fine, restart mds, all fine, touch dir, remount, all fine, restart mds again, snapshot timestamp changes to match.
Sorry I don't have more time to mess with this. FWIW I'd want to test any fix by running it through the snap workunits (particularly snaptest-2.sh). Those are probably a good smoke test for testing any changes in this area if it's tedious to reproduce your bug.
sage
Quoted 24 lines · Sage Weil
Quoted 14 lines · Alexandre Oliva
Quoted 3 lines · Sage Weil
Quoted 2 lines · Alexandre Oliva
This was supposed to fix bug 1946, and likely bug 1849 too, but it looks like something's still missing for a complete fix.
create snapshot
check timestamps -> baseline
unmount
mount again
check timestamps -> same
restart mds
check timestamps -> same
unmount
mount againQuoted 8 lines
check timestamps -> same
moved a tree into dir
check timestamps -> dir changed and snapshot unchanged, as expected unmount
mount again
check timestamps -> same
restart mds
check timestamps -> snapshot changed to dir's; its size too!
Quoted 1 line
It looks like the problem is that
CInode::firstisn't being journaled.
I see old_inodes are being journalled properly now. I've looked further into this tonight, and I found out what modifies the timestamps in the inode is (re)issuing caps to a client. I had a hw watchpoint on the timestamp in old_inodes, and it hit when I accessed the directory from a client, with this stack trace:
#0 0x0000000000668e1d in operator= (this=0x7fffb5513370)
at ../../src/mds/mdstypes.h:375
#1 CInode::cow_old_inode (this=0x7fffe09f6630, follows=..., cow_head=true)
at ../../src/mds/CInode.cc:2035
#2 0x000000000066972e in CInode::pre_cow_old_inode (this=0x7fffe09f6630)
at ../../src/mds/CInode.cc:2058
#3 0x00000000005dac8b in Locker::scatter_writebehind (this=0x1277500,
lock=0x7fffe09f6d78) at ../../src/mds/Locker.cc:3583
#4 0x00000000005e5bac in Locker::eval_gather (this=0x1277500,
lock=0x7fffe09f6d78, first=true, pneed_issue=0x7ffff4fc4f3f,
pfinishers=0x0) at ../../src/mds/Locker.cc:686
#5 0x00000000005e993e in eval_any (need_issue=0x7ffff4fc4f3f,
lock=<optimized out>, this=0x1277500) at ../../src/mds/Locker.h:103
#6 eval_any (need_issue=0x7ffff4fc4f3f, lock=0x7fffe09f6d78, this=0x1277500)
at ../../src/mds/Locker.cc:763
#7 Locker::eval (this=0x1277500, in=0x7fffe09f6630, mask=<optimized out>)
at ../../src/mds/Locker.cc:783
#8 0x00000000005f9ff9 in Locker::handle_client_caps (this=0x1277500,
m=0x7fff683e8620) at ../../src/mds/Locker.cc:2340
#9 0x00000000004ba900 in MDS::handle_deferrable_message (this=0x1272d70,
m=0x7fff683e8620) at ../../src/mds/MDS.cc:1742
#10 0x00000000004cddae in MDS::_dispatch (this=0x1272d70, m=<optimized out>)
at ../../src/mds/MDS.cc:1833---Type <return> to continue, or q <return> to quit---
old_inodes looks like this:
std::map with 1 elements = {[{val = 5}] = {first = {val = 2}, inode = {
ino = {val = 1099511627776}follows is 5 and first is 2 within CInode::pre_cow_old_inode.
So, how can we stop pre_cow_old_inode from messing with the old_inode? Any suggestions?
Thanks in advance,
Signature · 4 lines
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer
Quoted 5 lines · Alexandre Oliva
I've looked further into this tonight, and I found out what modifies the timestamps in the inode is (re)issuing caps to a client.
So, how can we stop
pre_cow_old_inodefrom messing with theold_inode? Any suggestions?
This patch seems to avoid the problem, but is it correct, or is it just papering over a problem elsewhere?
Subject: mds: Don't modify already-created old_inode
In cow_old_inode, do not modify an old_inode that was created before.
--- src/mds/CInode.cc | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
src/mds/CInode.cc +9 -5
@@ -2030,12 +2030,16 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs(); + bool found = old_inodes.find(follows) != old_inodes.end(); old_inode_t &old = old_inodes[follows]; - old.first = first; - old.inode = *pi; - old.xattrs = *px; - - dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + + if (!found) { + old.first = first; + old.inode = *pi; + old.xattrs = *px; + + dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + } old.inode.trim_client_ranges(follows);
Signature · 9 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer
Quoted 10 lines · Alexandre Oliva
Quoted 5 lines · Alexandre Oliva
I've looked further into this tonight, and I found out what modifies the timestamps in the inode is (re)issuing caps to a client.
So, how can we stop
pre_cow_old_inodefrom messing with theold_inode? Any suggestions?This patch seems to avoid the problem, but is it correct, or is it just papering over a problem elsewhere?
I think the real bug is that CInode::first is less than one of the old_inodes keys. Looking at cow_old_inode(), it looks like first should always be strictly > than all old_inodes keys. We should probably assert as much wherever it is convenient to do so...
In any case, can you see where/how that is happening? If this is a dir inode that has been commited and then refetched from the parent dir, that probably explains it. For non-multiversion inodes, dn->first == in->first, but not so for these guys, and at first glance I'm not seeing it in the CDir::_fetched() code.
sage
Quoted 52 lines
Subject: mds: Don't modify already-created
old_inodeIn
cow_old_inode, do not modify anold_inodethat was created before.Signed-off-by Alexandre Oliva <[email protected]>--- src/mds/CInode.cc | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)src/mds/CInode.cc +9
-5@@ -2030,12 +2030,16 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs(); + bool found = old_inodes.find(follows) != old_inodes.end(); old_inode_t &old = old_inodes[follows]; - old.first = first; - old.inode = *pi; - old.xattrs = *px; - - dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + + if (!found) { + old.first = first; + old.inode = *pi; + old.xattrs = *px; + + dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + } old.inode.trim_client_ranges(follows);Signature · 13 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Sage Weil
Quoted 10 lines · Alexandre Oliva
Quoted 5 lines · Alexandre Oliva
I've looked further into this tonight, and I found out what modifies the timestamps in the inode is (re)issuing caps to a client.
So, how can we stop
pre_cow_old_inodefrom messing with theold_inode? Any suggestions?This patch seems to avoid the problem, but is it correct, or is it just papering over a problem elsewhere?
I think the real bug is that
CInode::firstis less than one of theold_inodeskeys. Looking atcow_old_inode(), it looks like first should always be strictly > than allold_inodeskeys. We should probably assert as much wherever it is convenient to do so...
Quoted 5 lines
In any case, can you see where/how that is happening? If this is a dir inode that has been commited and then refetched from the parent dir, that probably explains it. For non-multiversion inodes,
dn->first==in->first, but not so for these guys, and at first glance I'm not seeing it in theCDir::_fetched()code.
This might do the trick?
src/mds/CDir.cc +2 -0
@@ -1564,6 +1564,8 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn) in->xattrs.swap(xattrs); in->decode_snap_blob(snapbl); in->old_inodes.swap(old_inodes); + if (!in->old_inodes.empty()) + in->first = in->old_inodes.rbegin()->first + 1; if (snaps) in->purge_stale_snap_data(*snaps);
Quoted 61 lines
sage
Quoted 52 lines
Subject: mds: Don't modify already-created
old_inodeIn
cow_old_inode, do not modify anold_inodethat was created before.Signed-off-by Alexandre Oliva <[email protected]>--- src/mds/CInode.cc | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)src/mds/CInode.cc +9
-5@@ -2030,12 +2030,16 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs(); + bool found = old_inodes.find(follows) != old_inodes.end(); old_inode_t &old = old_inodes[follows]; - old.first = first; - old.inode = *pi; - old.xattrs = *px; - - dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + + if (!found) { + old.first = first; + old.inode = *pi; + old.xattrs = *px; + + dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + } old.inode.trim_client_ranges(follows);Signature · 13 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PG's
All:
I have a 16-OSD cluster running 0.48 (Argonaut), built from source.
I rebuilt the entire cluster on Sunday Evening 8-19-2012, and started some rados testing.
I have a custom CRUSH map, that calls for the "rbd", "metadata" pools and a custom pool called "SCSI" to be pulled from osd.0-11, while the "data" pool is pulled from osd.12-15. While testing, I find that the cluster is putting data where I want it to, with one exception: the SCSI pool is not storing data evenly thoughout the osd.0-11. Through "df", I find that about every other osd is seeing space utilization.
So, whether good or bad, I did a "ceph osd reweight-by-utilization", which did improve the situation.
Now, after doing some more research in the mailing lists, I find that I should have just let the cluster figure it out on its own.
All that to lead to the problem I'm having now, and, I wish to use this mistake as a learning tool. My ceph status is this:
ceph -s
##
health HEALTH_WARN 377 pgs stale; 4 pgs stuck inactive; 377 pgs stuck stale; 948 pgs stuck unclean monmap e1: 3 mons at {a=10.9.181.10:6789/0,b=10.9.181.11:6789/0,c=10.9.181.12:6789/0}, election epoch 2, quorum 0,1,2 a,b,c osdmap e90: 16 osds: 16 up, 16 in
pgmap v5085: 3080 pgs: 4 creating, 1755 active+clean, 377 stale+active+clean, 944 active+remapped; 10175 MB data, 52057 MB used, 12244 GB / 12815 GB avail
mdsmap e16: 1/1/1 up {0=b=up:replay}, 2 up:standby
##
Side-affects: I can create and map any Rados pools. I cannot for the life of me, write to them, format them, anything them. Making my entire cluster offline to clients.
While I've parse and poured over the documentation, I really need experienced help, just to know how to get Ceph to recover, and then allow for operation again.
I've restarted each daemon individually several times, after which I've also tried a complete stop and start of the cluster. After things settle, this reveals the same ceph -s status as I've posted above.
Thanks for your time!
Ryan Nicholson
Re: PG's
Quoted 23 lines · Ryan Nicholson
All:
I have a 16-OSD cluster running 0.48 (Argonaut), built from source.
I rebuilt the entire cluster on Sunday Evening 8-19-2012, and started some rados testing.
I have a custom CRUSH map, that calls for the "rbd", "metadata" pools and a custom pool called "SCSI" to be pulled from osd.0-11, while the "data" pool is pulled from osd.12-15. While testing, I find that the cluster is putting data where I want it to, with one exception: the SCSI pool is not storing data evenly thoughout the osd.0-11. Through "df", I find that about every other osd is seeing space utilization.
So, whether good or bad, I did a "ceph osd reweight-by-utilization", which did improve the situation.
Now, after doing some more research in the mailing lists, I find that I should have just let the cluster figure it out on its own.
All that to lead to the problem I'm having now, and, I wish to use this mistake as a learning tool. My ceph status is this:
ceph -s
##
healthHEALTH_WARN377 pgs stale; 4 pgs stuck inactive; 377 pgs stuck stale; 948 pgs stuck unclean monmap e1: 3 mons at {a=10.9.181.10:6789/0,b=10.9.181.11:6789/0,c=10.9.181.12:6789/0}, election epoch 2, quorum 0,1,2 a,b,c osdmap e90: 16 osds: 16 up, 16 inpgmap v5085: 3080 pgs: 4 creating, 1755 active+clean, 377 stale+active+clean, 944 active+remapped; 10175 MB data, 52057 MB used, 12244 GB / 12815 GB availmdsmap e16: 1/1/1 up {0=b=up:replay}, 2 up:standby
##
Quoted 7 lines
Side-affects: I can create and map any Rados pools. I cannot for the life of me, write to them, format them, anything them. Making my entire cluster offline to clients.
While I've parse and poured over the documentation, I really need experienced help, just to know how to get Ceph to recover, and then allow for operation again.
I've restarted each daemon individually several times, after which I've also tried a complete stop and start of the cluster. After things settle, this reveals the same ceph -s status as I've posted above.
Thanks for your time!
You'll want to start by running "ceph pg dump" and trying to find patterns in the PGs that are stale. If you put it up on pastebin or something I'm sure somebody will be happy to check it out too. PGs that are remapped are a problem with your CRUSH map — can you also post it?
And just for good measure we might as well see the output of "ceph osd dump" as well.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: PG's
Thanks, Greg! Here's the link to all of the dumps you asked for: http://pastebin.com/y4bPwSz8
Let me know what you think!
Ryan Nicholson
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Gregory Farnum
Sent: Thursday, August 23, 2012 2:41 PM
To: Ryan Nicholson
Cc: [email protected]
Subject: Re: PG's
Quoted 22 lines · Ryan Nicholson
All:
I have a 16-OSD cluster running 0.48 (Argonaut), built from source.
I rebuilt the entire cluster on Sunday Evening 8-19-2012, and started some rados testing.
I have a custom CRUSH map, that calls for the "rbd", "metadata" pools and a custom pool called "SCSI" to be pulled from osd.0-11, while the "data" pool is pulled from osd.12-15. While testing, I find that the cluster is putting data where I want it to, with one exception: the SCSI pool is not storing data evenly thoughout the osd.0-11. Through "df", I find that about every other osd is seeing space utilization.
So, whether good or bad, I did a "ceph osd reweight-by-utilization", which did improve the situation.
Now, after doing some more research in the mailing lists, I find that I should have just let the cluster figure it out on its own.
All that to lead to the problem I'm having now, and, I wish to use this mistake as a learning tool. My ceph status is this:
ceph -s
##
healthHEALTH_WARN377 pgs stale; 4 pgs stuck inactive; 377 pgs stuck stale; 948 pgs stuck unclean monmap e1: 3 mons at {a=10.9.181.10:6789/0,b=10.9.181.11:6789/0,c=10.9.181.12:6789/0}, election epoch 2, quorum 0,1,2 a,b,c osdmap e90: 16 osds: 16 up, 16 inpgmap v5085: 3080 pgs: 4 creating, 1755 active+clean, 377 stale+active+clean, 944 active+remapped; 10175 MB data, 52057 MB used, 12244 GB / 12815 GB availmdsmap e16: 1/1/1 up {0=b=up:replay}, 2 up:standby ##
Quoted 7 lines
Side-affects: I can create and map any Rados pools. I cannot for the life of me, write to them, format them, anything them. Making my entire cluster offline to clients.
While I've parse and poured over the documentation, I really need experienced help, just to know how to get Ceph to recover, and then allow for operation again.
I've restarted each daemon individually several times, after which I've also tried a complete stop and start of the cluster. After things settle, this reveals the same ceph -s status as I've posted above.
Thanks for your time!
You'll want to start by running "ceph pg dump" and trying to find patterns in the PGs that are stale. If you put it up on pastebin or something I'm sure somebody will be happy to check it out too. PGs that are remapped are a problem with your CRUSH map - can you also post it? And just for good measure we might as well see the output of "ceph osd dump" as well.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: PG's
In reply to Gregory FarnumGreg I've also attached a "ceph osd tree" dump (above). From what I can tell, the tree is correct, and lines up with how I desire to weight the cluster(s), however, I do see that the reweight for the smaller osds (SCSI-Nodes) are less than 1. Perhaps I need to look at this?
Thanks,
Ryan Nicholson
(ryann)
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Gregory Farnum
Sent: Thursday, August 23, 2012 2:41 PM
To: Ryan Nicholson
Cc: [email protected]
Subject: Re: PG's
Quoted 22 lines · Ryan Nicholson
All:
I have a 16-OSD cluster running 0.48 (Argonaut), built from source.
I rebuilt the entire cluster on Sunday Evening 8-19-2012, and started some rados testing.
I have a custom CRUSH map, that calls for the "rbd", "metadata" pools and a custom pool called "SCSI" to be pulled from osd.0-11, while the "data" pool is pulled from osd.12-15. While testing, I find that the cluster is putting data where I want it to, with one exception: the SCSI pool is not storing data evenly thoughout the osd.0-11. Through "df", I find that about every other osd is seeing space utilization.
So, whether good or bad, I did a "ceph osd reweight-by-utilization", which did improve the situation.
Now, after doing some more research in the mailing lists, I find that I should have just let the cluster figure it out on its own.
All that to lead to the problem I'm having now, and, I wish to use this mistake as a learning tool. My ceph status is this:
ceph -s
##
healthHEALTH_WARN377 pgs stale; 4 pgs stuck inactive; 377 pgs stuck stale; 948 pgs stuck unclean monmap e1: 3 mons at {a=10.9.181.10:6789/0,b=10.9.181.11:6789/0,c=10.9.181.12:6789/0}, election epoch 2, quorum 0,1,2 a,b,c osdmap e90: 16 osds: 16 up, 16 inpgmap v5085: 3080 pgs: 4 creating, 1755 active+clean, 377 stale+active+clean, 944 active+remapped; 10175 MB data, 52057 MB used, 12244 GB / 12815 GB availmdsmap e16: 1/1/1 up {0=b=up:replay}, 2 up:standby ##
Quoted 7 lines
Side-affects: I can create and map any Rados pools. I cannot for the life of me, write to them, format them, anything them. Making my entire cluster offline to clients.
While I've parse and poured over the documentation, I really need experienced help, just to know how to get Ceph to recover, and then allow for operation again.
I've restarted each daemon individually several times, after which I've also tried a complete stop and start of the cluster. After things settle, this reveals the same ceph -s status as I've posted above.
Thanks for your time!
You'll want to start by running "ceph pg dump" and trying to find patterns in the PGs that are stale. If you put it up on pastebin or something I'm sure somebody will be happy to check it out too. PGs that are remapped are a problem with your CRUSH map - can you also post it? And just for good measure we might as well see the output of "ceph osd dump" as well.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: PG's
Wow, those are quite a dynamic range of numbers — I'm not sure you can count on the cluster behaving well with that much happening in the overrides. If you actually have OSDs with varying capacity, you should give them different CRUSH weights (using "ceph osd crush set ...") rather than using the monitor's reweight functionality.
I confess I don't see exactly why so many PGs are stale, but fixing the weights certainly won't hurt.
-Greg
Quoted 45 lines · Ryan Nicholson
Greg I've also attached a "ceph osd tree" dump (above). From what I can tell, the tree is correct, and lines up with how I desire to weight the cluster(s), however, I do see that the reweight for the smaller osds (SCSI-Nodes) are less than 1. Perhaps I need to look at this?
Thanks,
Ryan Nicholson
(ryann)-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Gregory Farnum
Sent: Thursday, August 23, 2012 2:41 PM
To: Ryan Nicholson
Cc: [email protected]
Subject: Re: PG'sQuoted 28 lines · Ryan Nicholson
All:
I have a 16-OSD cluster running 0.48 (Argonaut), built from source.
I rebuilt the entire cluster on Sunday Evening 8-19-2012, and started some rados testing.
I have a custom CRUSH map, that calls for the "rbd", "metadata" pools and a custom pool called "SCSI" to be pulled from osd.0-11, while the "data" pool is pulled from osd.12-15. While testing, I find that the cluster is putting data where I want it to, with one exception: the SCSI pool is not storing data evenly thoughout the osd.0-11. Through "df", I find that about every other osd is seeing space utilization.
So, whether good or bad, I did a "ceph osd reweight-by-utilization", which did improve the situation.
Now, after doing some more research in the mailing lists, I find that I should have just let the cluster figure it out on its own.
All that to lead to the problem I'm having now, and, I wish to use this mistake as a learning tool. My ceph status is this:
ceph -s
##
healthHEALTH_WARN377 pgs stale; 4 pgs stuck inactive; 377 pgs stuck stale; 948 pgs stuck unclean monmap e1: 3 mons at {a=10.9.181.10:6789/0,b=10.9.181.11:6789/0,c=10.9.181.12:6789/0}, election epoch 2, quorum 0,1,2 a,b,c osdmap e90: 16 osds: 16 up, 16 inpgmap v5085: 3080 pgs: 4 creating, 1755 active+clean, 377 stale+active+clean, 944 active+remapped; 10175 MB data, 52057 MB used, 12244 GB / 12815 GB availmdsmap e16: 1/1/1 up {0=b=up:replay}, 2 up:standby ##
Side-affects: I can create and map any Rados pools. I cannot for the life of me, write to them, format them, anything them. Making my entire cluster offline to clients.
While I've parse and poured over the documentation, I really need experienced help, just to know how to get Ceph to recover, and then allow for operation again.
I've restarted each daemon individually several times, after which I've also tried a complete stop and start of the cluster. After things settle, this reveals the same ceph -s status as I've posted above.
Quoted 9 lines
Quoted 1 line
Thanks for your time!
You'll want to start by running "ceph pg dump" and trying to find patterns in the PGs that are stale. If you put it up on pastebin or something I'm sure somebody will be happy to check it out too. PGs that are remapped are a problem with your CRUSH map - can you also post it? And just for good measure we might as well see the output of "ceph osd dump" as well.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
src/mds/CDir.cc
Quoted 8 lines · Sage Weil
This might do the trick?
src/mds/CDir.cc +2
-0in->old_inodes.swap(old_inodes); + if (!in->old_inodes.empty()) + in->first = in->old_inodes.rbegin()->first + 1; if (snaps)
At first, it didn't. I had to install/keep a few additional patches to avoid “corruption” of old snapshots. Later on, I guess all “first” fields in the journal were corrected, and then I didn't get the warnings added by my patches any more. So it may be that your patch is enough, after all, but this is the patchset I've used over the past week, with a very little bit of snapshot creation.
Unfortunately, modifying snapshotted directories, particularly mass removal of subtrees, is still triggering some serious issues in the mds (crashes, infinite loops, unrecoverable clusters, all sorts of fun stuff :-), but I'm yet to look into that.
mds: update cached first along with old_inodes
When fetching a directory, make sure first is greater than the fetched old_inodes.
--- src/mds/CDir.cc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
src/mds/CDir.cc +5 -0
@@ -1564,6 +1564,11 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn) in->xattrs.swap(xattrs); in->decode_snap_blob(snapbl); in->old_inodes.swap(old_inodes); + if (!in->old_inodes.empty()) { + snapid_t newfirst = in->old_inodes.rbegin()->first + 1; + if (newfirst > in->first) + in->first = newfirst; + } if (snaps) in->purge_stale_snap_data(*snaps);
Signature · 11 lines
1.7.7.6 mds: Don't modify already-created old_inode In cow_old_inode, do not modify an old_inode that was created before. Signed-off-by: Alexandre Oliva <[email protected]> --- src/mds/CInode.cc | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-)
src/mds/CInode.cc +11 -5
@@ -2030,12 +2030,18 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs(); + bool found = old_inodes.find(follows) != old_inodes.end(); old_inode_t &old = old_inodes[follows]; - old.first = first; - old.inode = *pi; - old.xattrs = *px; - - dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + + if (!found) { + old.first = first; + old.inode = *pi; + old.xattrs = *px; + + dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + } else + dout(0) << "cow_old_inode not modifying existing old_inode " << first + << " for " << follows << " on " << *this << dendl; old.inode.trim_client_ranges(follows);
Signature · 11 lines
1.7.7.6 mds: warn when first is lower than latest old_inode Warn in cow_old_inode if first is out of date WRT old_inodes. Signed-off-by: Alexandre Oliva <[email protected]> --- src/mds/CInode.cc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
src/mds/CInode.cc +5 -0
@@ -2027,6 +2027,11 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) { assert(follows >= first); + if (!old_inodes.empty() && first <= old_inodes.rbegin()->first) { + dout(0) << "cow_old_inode " << " first " << first << " but already had " + << old_inodes.rbegin()->first << " on " << *this << dendl; + } + inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs();
Signature · 13 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 40 lines · Alexandre Oliva
src/mds/CDir.cc
Quoted 8 lines · Sage Weil
This might do the trick?
src/mds/CDir.cc +2
-0in->old_inodes.swap(old_inodes); + if (!in->old_inodes.empty()) + in->first = in->old_inodes.rbegin()->first + 1; if (snaps)At first, it didn't. I had to install/keep a few additional patches to avoid ?corruption? of old snapshots. Later on, I guess all ?first? fields in the journal were corrected, and then I didn't get the warnings added by my patches any more. So it may be that your patch is enough, after all, but this is the patchset I've used over the past week, with a very little bit of snapshot creation.
Unfortunately, modifying snapshotted directories, particularly mass removal of subtrees, is still triggering some serious issues in the mds (crashes, infinite loops, unrecoverable clusters, all sorts of fun stuff :-), but I'm yet to look into that.
mds: update cached first along with
old_inodesWhen fetching a directory, make sure first is greater than the fetched
old_inodes.Signed-off-by Alexandre Oliva <[email protected]>Suggested-by Sage Weil <[email protected]>--- src/mds/CDir.cc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)src/mds/CDir.cc +0
-0
src/mds/CDir.cc void CDir::_fetched(bufferlist &bl, const string& want_dn) · line 1570
Quoted 7 lines
src/mds/CDir.cc +4
-0@@ -1564,6 +1564,11 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn) in->xattrs.swap(xattrs); in->decode_snap_blob(snapbl); in->old_inodes.swap(old_inodes); + if (!in->old_inodes.empty()) { + snapid_t newfirst = in->old_inodes.rbegin()->first + 1; + if (newfirst > in->first) + in->first = newfirst;
Hmm, did you observe a case where in->first was already > the newest old_inode?
sage
Quoted 90 lines
src/mds/CDir.cc +1
-0+ } if (snaps) in->purge_stale_snap_data(*snaps);Signature · 11 lines
1.7.7.6 mds: Don't modify already-created old_inode In cow_old_inode, do not modify an old_inode that was created before. Signed-off-by: Alexandre Oliva <[email protected]> --- src/mds/CInode.cc | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-)src/mds/CInode.cc +11
-5@@ -2030,12 +2030,18 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs(); + bool found = old_inodes.find(follows) != old_inodes.end(); old_inode_t &old = old_inodes[follows]; - old.first = first; - old.inode = *pi; - old.xattrs = *px; - - dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + + if (!found) { + old.first = first; + old.inode = *pi; + old.xattrs = *px; + + dout(10) << " " << px->size() << " xattrs cowed, " << *px << dendl; + } else + dout(0) << "cow_old_inode not modifying existing old_inode " << first + << " for " << follows << " on " << *this << dendl; old.inode.trim_client_ranges(follows);Signature · 11 lines
1.7.7.6 mds: warn when first is lower than latest old_inode Warn in cow_old_inode if first is out of date WRT old_inodes. Signed-off-by: Alexandre Oliva <[email protected]> --- src/mds/CInode.cc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)src/mds/CInode.cc +5
-0@@ -2027,6 +2027,11 @@ old_inode_t& CInode::cow_old_inode(snapid_t follows, bool cow_head) { assert(follows >= first); + if (!old_inodes.empty() && first <= old_inodes.rbegin()->first) { + dout(0) << "cow_old_inode " << " first " << first << " but already had " + << old_inodes.rbegin()->first << " on " << *this << dendl; + } + inode_t *pi = cow_head ? get_projected_inode() : get_previous_projected_inode(); map<string,bufferptr> *px = cow_head ? get_projected_xattrs() : get_previous_projected_xattrs();Signature · 13 lines
1.7.7.6 -- Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Sage Weil
src/mds/CDir.cc void CDir::_fetched(bufferlist &bl, const string& want_dn) · line 1570
Quoted 4 lines
src/mds/CDir.cc +4
-0+ if (!in->old_inodes.empty()) { + snapid_t newfirst = in->old_inodes.rbegin()->first + 1; + if (newfirst > in->first) + in->first = newfirst;Hmm, did you observe a case where
in->firstwas already > the newestold_inode?
No, that was just me doing defensive programming and forgetting to add a warning for this case ;-)
IIRC I reasoned I didn't want an already-bugfixed or already-advanced in->first in the MDS journal to be overwritten with a buggy/outdated ->first from the inode proper. However, since I didn't put the warning, I don't know whether it ever hit :-(
Signature · 4 lines
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer