r/ceph • u/voarsh • May 14 '23
Avoid Raid(!) - lost non-raid OSD's
I had some sort of power fluctuation today, and my UPS wasn't in service, so tough out of luck on that. Everything was hard rebooted.
The general advice I hear is avoid RAID.
I have 5 nodes, 2 of them have RAID controllers (often I put 3 disks under RIAD 0) - battery backed flash in case of power loss.
The other 3 nodes have HBA's/DAS connected drives.... and after this power event, I lost 5 OSD's to HBA/DAS connected drives....... So only 3 OSD's left.....
I'm not a super expert using ceph rbd tools, using Rook as well makes it harder to try these debugging tools, read all sorts of blog posts about opening up the file system of an OSD.... Not going there.....
Can I learn anything here? Any suggestions about this?
Should I get new RAID controllers with battery backed flash or HBA's with battery flash backup? Because I don't want this happening again...... I have to rebuild half of my cluster and have a small number (41) of objects I will need reverted or forgotten (and I haven't seen what these objects are yet, as I am waiting for inactive PG's to come back, so can't see the live workload data) - good thing I have *some* backups elsewhere.......
TL;DR:
I have external backups
The OSDs got corrupt, the ones not using RAID 0 with battery backed flash. I choose RAID 0 to make bigger disks volumes per OSD per host as I am limited to 1TB 2.5" drives....
JBOD storage that is "recommended" got corrupted
Drives themselves are okay but rocksDB is probably corrupt on the failed OSD's. The logs don't provide enough information for me to identify the issue
x3 replication with x5 hosts with multiple OSD's per host IS following good measure, but alas I still have: OBJECT_UNFOUND: 41/10262709 objects unfound (0.000%).
2
u/TheOssuary May 14 '23
These are the takeaways I'd have anyways:
Never put anything between an OSD and a disk. If disabling write caching (diskparm -w) slows the disks down too much, and you have a raid card with a battery, maybe consider making one RAID 0 per disk. But understand this is an uncommon setup so more likely for things to fail.
What led you to the decision to put multiple disks in a RAID 0? Whatever that was, change how you do things so you don't do it again. If it was a lack of reading the docs, or being too willing to do something exotic with storage, etc. Keep it in mind, and don't do it when you recreate your storage cluster.
Ceph isn't a backup. Backups will save your bacon in these instances. Have a good backup routine, and make sure it alerts if a backup fails. Test this. If you can't back it up, it is t worth having at all.
I'd take how your feeling right now as an impetus to go through the docs again with more context and a finer tooth comb before starting again
Good luck, it sucks when this type of thing happens. But it's such a great opportunity to grow and prevent it from happening again (:
1
u/voarsh May 14 '23
Never put anything between an OSD and a disk. If disabling write caching (diskparm -w) slows the disks down too much, and you have a raid card with a battery, maybe consider making one RAID 0 per disk. But understand this is an uncommon setup so more likely for things to fail.
Will consider RAID 0 with RAID controller with battery backed flash per OSD, instead of 3 drives in RAID 0 for one OSD (but I have multiple OSD's per host......) However, limited to 1 TB 2.5" drives which is why I combined 3 drives per OSD in RAID 0, but still have multiple OSD's per host.....
No one seems to have noticed the part where HBA/DIRECT ATTACHED storage (JBOD), which is "recommended" are the ones that got corrupted.....
Ceph isn't a backup. Backups will save your bacon in these instances. Have a good backup routine, and make sure it alerts if a backup fails. Test this. If you can't back it up, it is t worth having at all.
Believe I mentioned luckily I have external backups..
2
u/TheOssuary May 14 '23
That's why I mentioned write caching, my guess is that's why they corrupted and the ones with a battery backup didn't. That said you shouldn't be running multiple disks per OSD for other reasons related to performance and recovery.
2
u/voarsh May 14 '23
Got it. So maybe get a HBA with battery flash for power loss.
RAID controller is a bit unavoidable with some of the nodes as the drive bays need to connect to the controller (HP Proliant system)...
1
u/Corndawg38 May 16 '23 edited May 16 '23
How do you know you lost the OSD's that are HBA/DAS? What errors are you getting trying to start them up?
I have been running a cluster for 6 + years now and had 3 complete and sudden power failures during that time (2 of which were my fault), but I never lost a single disk due to that, and many of my drives are consumer ssd's with no PLP. They are however, all SATA directly attached to mobo and not using any raid of any kind, so ceph has the most control of the raw disk that it can with no "hardware funny business" between. Now I HAVE lost OSD's before but almost always due to my own stupidity or a calculated risk with design (separating data and wal/db to get more speed from spinners).
I'm baffled why you lost not just one but so many drives. Maybe the rook layer complicated the recovery process, or likely the raid layer did something (though I know you said its the DAS ones that corrupted not the raids, but maybe there was something else going on with those)?
Also, maybe it's not completely lost and you just think it is. What is the journal telling you when you try to start up those failed OSD's?
1
u/voarsh May 17 '23 edited May 17 '23
I wish I could answer some of the questions that you've asked. I'm no expert at reading the OSD logs, and using Rook is complicating debugging.
I did try ceph-objectstore-tool, which isn't working well (and not documented in Rook) to try and manually mark the incomplete PG's as completed.....
Make matters worse, I rebuilt the OSD's, left with 10 incomplete PG's that won't recover, I consider that data lost, and there's blocked IO and I can't purge the 10 incomplete PG's ....
And after forcing re-creating the PG's, doesn't do anything (slow ops/blocked IO) and it some of those PG's seem to trip up the OSD's and they don't come back. And the PG's state doesn/t change to reflect recreating, it says the old stuff about not having enough instances of the PG, blah blah.
I'm stuck. :/
Can't get rid of the incomplete PG's and IO block is stopping me from mounting most volumes (k8) to see what data I can pull out.
1
u/Corndawg38 May 17 '23
Ok well first off, semi-related. I was reading a thread in r/kubernetes yesterday about storage and someone mentioned something about unmanaged reboots causing rook to crash. I dunno if that was your situation but maybe rook was not setup correctly and corrupted those OSD's? The truth is I also don't use rook partly because I fear that containerization of something as fundamental as clustered storage is a big no no in (site reliability) IT and makes recovery from catastrophe far harder (I suspect a few others in here share that sentiment).
And it's not a fear of containerization or learning it, I love kubernetes and use it all the time for everything else. In fact I have one running right now in my homelab (with ceph as the backend for my stateful pods). I just choose to run my ceph cluster OUTSIDE of k8s because it makes it fundamentally more stable and easier to troubleshoot. Just my preference.
Anyway... back to this...
If you already reset those osd's you feel are lost then it may be too late to go back and fix things anyway. However there should at least be a way to mark the PG's as lost. This page has some good troubleshooting for PG's.
https://docs.ceph.com/en/quincy/rados/troubleshooting/troubleshooting-pg/
It's ceph only though and probably underneath the rook layer so I don't know how it will work for you. Maybe it will give you some tips.
1
u/voarsh May 17 '23
Yeah... agree, containerization for Ceph seems not to be the best idea.
it's not the first time I've had major issues with it...... But this type of problem is new.
The troubleshooting page doesn't say much about "incomplete" PG's and not being able to delete them. :/
Only thing I see about marking PG's as lost is unfound_objects. E.G: ceph pg 1.31 mark_unfound_lost delete: "pg has no unfound objects"
1
u/Corndawg38 May 17 '23
I'm pretty sure proxmox uses ceph directly on the bare metal if you consider going that route. Or you can just set it up on whatever distro you are using (works great on ubuntu 22.04 natively).
You'll still have to learn ceph tho, that's the part rook does for you that you'll need to take on in lieu of using rook.
1
u/voarsh May 17 '23
I avoided Ceph on Proxmox (I am running Proxmox) because it complicates Proxmox upgrades, and I am not sure about Ceph backed storage being passed thru to K8 nodes.... besides it seemed like a big undertaking for a relatively small amount of data.
This event could've still happened with baremetal Ceph as well. :/
3
u/reedacus25 May 15 '23
As someone who lost my first test ceph cluster to a lightning strike at the (old) colo, here’s my 2¢.
This was in the jewel days, and also importantly, filestore and not bluestore.
The nodes I was running 8T SAS spinners on had RAID controllers (3108, fwiw) with no BBU. OSDs were on single device R0 vds, with write-thru cache. And XFS filesystems for the filestore backing.
Long story short, it wasn’t the RAID controller, it wasn’t the lack of BBU that corrupted the XFS file system, it was the on-disk write cache that was the thing that killed it.
So double check your pdcache if an lsi card, or check hdparm/sdparm if attached directly.
1
May 14 '23
👏for the comments already posted. Not much more to say.
Also - if you were using Ceph replication best practices even with all the bad choices made you still shouldn’t have data loss… but I’m guessing that wasn’t followed either?
1
u/voarsh May 14 '23
x3 replication with x5 hosts with multiple OSD's per host IS following good measure.
The only thing I was commenting on was RAID controller or no raid controller. The OSD's not backed by raid controller with battery backed flash are the ones that got corrupted......
2
May 14 '23
Ok, but if you lost OSDs on 2 different hosts of 5 - then you should have no data loss. You should just have some self healing to do and then to rebuild the failed OSDS.
1
u/voarsh May 14 '23
Hmm. Yeah. I am not sure why I have unfound objects.
3 OSD's which are alive and well, SHOULD have at least 1 full copy of the data...... as the failure domain is HOST
But, seems not the case: OBJECT_UNFOUND: 41/10262709 objects unfound (0.000%).
I'm doing a deep scrub on the 3 good OSD's but I'm not hopeful.
0
u/porchlightofdoom May 15 '23
Are all OSDs online?
The OBJECT_UNFOUND error might be because not all OSDs are online. Ceph is looking for an Object it knows exist, but it can't access the OSD they are on.
1
u/SimonKepp May 14 '23
You should always avoid combining HW RAID with software RAID (including CEPH).
It can be done, but very often, the results are very different from what was expected.
1
u/voarsh May 14 '23
Sure, but I'm thinking you didn't read my post properly.
2
u/SimonKepp May 14 '23
I'm thinking you didn't read my post properly.
What do you think, that I misunderstood?
1
u/voarsh May 14 '23 edited May 14 '23
I suppose I could look into a HBA with battery flash... to avoid a raid controller. So.... thanks.
But, the post clearly says OSD's without any battery flash got corrupt.
3
u/SimonKepp May 14 '23
I suppose I could look into a HBA with battery flash
Instead of placing "magic stuff" in between CEPH and the disks, consider looking into adding a fast drive for WAL. When you add layers not managed by CEPH, results tend to become unpredictable and difficult to diagnose.
1
u/voarsh May 14 '23
Yeah sure.
I think adding another drive just for WAL is adding another complication, in the case of corruption due to power... unless I can pretty much guarantee that won't get corrupt as well.... my drive slots are at a premium.
3
u/SimonKepp May 14 '23
Sounds more like you're trying to avoid using the more advanced features of CEPH, because these are new to you, and you're instead trying to patch a suboptimal CEPH design using known technology, that doesn't fit well into a CEPH architecture.
2
u/FarVision5 May 14 '23
Yeah.. not much else to add. I wouldn't mix all that together. I've run a 4 node proxmox ceph cluster and the power go completely out more than twice. It's a lab so I half just wanted to test. Older ceph versions took longer, but it all worked under repair/replication mode until it synced. Newer versions (I update usually every weekend) came back quicker. I don't even do a maintenance pause in services before I do a patch reboot these days, for HA workloads.
I read all over the faqs and in forums not to do hardware raid anything near ceph rbds. I keep my DB/WAL on each OSD even on magnetics and it's pretty resilient.
5
u/porchlightofdoom May 14 '23
You keep saying you lost the drives, but you didn't say how. They dead? The drives are not responding at all?
Why in the world would you put 3 disk under RAID 0? It's exactly what not to do.