4 ms·
Since no Mac device has two power support adding a second UPS means chaining which will only increase the risk of something going wrong in the chain. Nobody ex
by freemint 5y ago
Since no Mac device has two power support adding a second UPS means chaining which will only increase the risk of something going wrong in the chain.
Nobody expects 100% data integrity on power of. What is expected is that data that what was fsynced has 100% data integrity once that system call returns. This information is also used when moving files across the network, the file gets deleted on the sender when the receiver said fsync is completed. This means you could loose entire files of data when moving things over the network onto a Mac
- EugeneOZ 5y agoThis means the world would be full of complaints from macOS users, but for some reason, we only know about this detail because of that “shocking” Twitter thread.
- marcan_42 5y ago#!/usr/bin/python import os, sys, time, datetime t = datetime.datetime.now().isoformat() print(t) for i in range(5): time.sleep(1) print(4 - i) fd = os.open(sys.argv[1], os.O_RDWR|os.O_CREAT) os.lseek(fd, 0, 0) os.write(fd, b"test: " + t.encode("ascii") + b"\n"); os.fsync(fd) print("done!") time.sleep(100) Run that on a Mac Mini. Do it a couple times. Remember the timestamp of the last one. Let it count down, then pull the plug within a few seconds after "done!" shows up. Boot up again. The file contents will have reverted to a prior point in time. This isn't some hypothetical thing, this is a trivial test you can do. fsync() on macOS does not guarantee data is on stable storage. And this is actually well documented. Then if you want to see the performance problem, make it a loop instead and use `fcntl.fcntl(fd, fcntl.F_FULLFSYNC, 1)`. You'll get 40-odd IOPS, but at least your data won't disappear after power loss.
- EugeneOZ 5y agoDoes it somehow prove that people are losing files when transferring them over the network? People would definitely notice it.
- marcan_42 5y agoYou're very persistent, aren't you? marcan@raider:~/tmp -$ echo "very important data" > file.txt marcan@raider:~/tmp -$ rsync --remove-source-files file.txt macmini.lan: Yanked power to macmini.lan after the rsync completed, then turned it on again marcan@raider:~/tmp -$ ls file.txt ls: cannot access 'file.txt': No such file or directory marcan@raider:~/tmp 2$ ssh macmini.lan Last login: Thu Feb 17 23:45:26 2022 from 192.168.3.10 marcan@Mini-M1-2020 ~ % ls file.txt ls: file.txt: No such file or directory Data's gone. This is real, please stop pretending it isn't.
- EugeneOZ 5y agoAt least I’m not as rude as you. You’ll need to be persistent to accomplish your results with the Asahi Linux project - good luck with that. I had no doubts that you can lose your file if you are moving it and some very lucky power outage hits. I was not “pretending” it's not real. What I have doubts about, is that it's a real concern for 99.93% of the users. As we’ve found here, it's not even a rare case in other kinds of OS, so users would definitely notice it. It is theoretically possible, of course. In practice, it's just too rare to consider. But still, I hope this topic will be noticed by Apple and they fix that low performance issue for fullsync. Also, I hope they will not make fullsync as the default behavior - it doesn't worth the risks (and those for whom it does - should use some Linux for sure).
- camgunz 5y agoYou're missing the point. Anything wanting data integrity will now have to use F_FULLFSYNC, which is slow on this firmware. You might say "you shouldn't care about data integrity to this degree", but databases do, and lots of developers run databases on their machines, and now they'll be real slow. Maybe they'll add some config options like `i_promise_i_dont_care_about_data_integrity = 1`, but come on.
- EugeneOZ 5y agoI’ve mentioned this issue.
- layer8 5y agoLooking at the Apple support forums, the world is full of complaints about all sorts of malfunctions (which may or may not be related).
- EugeneOZ 5y agoNot sure if intentional or not, but it was a good joke, thanks :)
- marcan_42 5y agoFor what it's worth, adding an external UPS to a Mac laptop counts as two, and in fact you can add one per Type C port + MagSafe, so you can have up to 5 battery backups for the 2021 Macbook Pro line (internal + MagSafe + 3 x Type C). It's silly, but you can :-)
- freemint 5y agoI never considered Mac Laptops as they are not vulnerable to data loss in case of a power outage. How is the situation with Mac Minis which don't have a battery? Are there multiple redundant power input the Mac Mini can switch in-between without tuning of?
- marcan_42 5y agoThere aren't; you'd have to hack that in. It should be possible, though, since I think the entire system is powered from a single primary 12V rail internally.
- freemint 5y agoDoesn't sound like something (most) Mac Users would do. And I am also quiet honoured that the marcan_42 replied to my mere comment. Keep doing what you are doing, if you feel you are doing great doing so.