Comments (15)
What was the original reason for having the software fail on lack of O_DIRECT? Was it merely to save time implementing the fallback, or are there things that fail when the file is opened without it?
from rethinkdb.
Let me rephrase that so that it doesn't sound like I don't know the importance of O_DIRECT for a database. What was the original reason for not allowing a bypass? Was it effort required to implement the fallback in disk.cc, things that broke elsewhere, or fear of cache crowding and other serious system performance problems?
from rethinkdb.
Basically, we just didn't think about it :)
from rethinkdb.
So the low-level support in disk.cc seems to be present after all, just not commented. The argument is_really_direct to linux_file_t::linux_file_t (which is not Linux-specific anymore) controls whether one requests O_DIRECT or F_NOCACHE. All that we need to do is to implement a choice between the typedefs direct_file_t and nondirect_file_t in log_serializer.cc. We could pass the information to that point (from command_line stuff) via extra function arguments (either a session object or a simple flag for this option) or via a global variable. What would be preferable here?
from rethinkdb.
I haven't looked at this stuff in a while, but here are two problems that I can think of off the top of my head:
- F_NOCACHE may or may not be supported on all platforms
- O_DIRECT implies that when one writes a block, the function does not return until the disk driver responds that the block has been committed to disk. This isn't the case without O_DIRECT, and may or may not be the case with F_NOCACHE. We need this behavior for sane operation, so we'll have to make sure it's replicated when O_DIRECT is off (one way to do that is to throw in fsyncs)
from rethinkdb.
- F_NOCACHE is just for the Macintosh (or whatever you call a sharp-edged aluminum computer that does not support O_DIRECT).
- I thought that we were willing to allow the user to bypass the disk commit safeguards in this case since it was just for testing. I can examine options for verifying a commit to disk without O_DIRECT if you like.
from rethinkdb.
As it turns out, O_DIRECT does not provide guarantees about data commits like O_SYNC. Would we also want to provide an O_SYNC option?
from rethinkdb.
We want O_DSYNC (which Linux allegedly treats O_SYNC as, anyway).
We warn the user when O_DIRECT doesn't work and pass O_DSYNC in any case.
This is currently in code review 134.
from rethinkdb.
What do we do in OSX for sync?
from rethinkdb.
Nothing yet. If we want proper syncing in OS X we can follow up each write() call with fcntl(fd, F_FULLFSYNC)
.
from rethinkdb.
@srh -- presumably we'd only need to do it twice -- once before writing the metablock, and once after.
from rethinkdb.
@coffeemug - I'm going to do F_FULLFSYNC
in the I/O layer after every write call. This allegedly replicates O_DSYNC
behavior (except that it presumably also syncs file metadata). Also, there's no reason it would perform worse (except for the relatively negligible cost of an extra syscall on a thread in the i/o pool) than some specific fsync calls made in the serializer.
from rethinkdb.
This is fixed, with F_FULLFSYNC and O_DSYNC options enabled.
from rethinkdb.
@srh -- could you please specify review number and commit number?
from rethinkdb.
@srh -- ping -- could you specify review number and commit number? What is the warning message the users get if DIRECT_IO isn't available?
from rethinkdb.
Related Issues (20)
- Rethinkdb Proxy
- Set a name to a proxy name HOT 3
- Add "Buffers" from /proc/meminfo in parse_meminfo_file to determine available memory
- download.rethinkdb.com is down, 502 Bad Gateway HOT 1
- Evaluate Profile-Guided Optimization (PGO) on RethinkDB
- error: to_string called on an uninitialized ip_address_t, addr_type: 0 compiling rethinkdb on Raspberry HOT 6
- RethinkDB not fully supported on Raspberry PI OS Bullseye (32/64 bit) HOT 10
- Reasonable to change hard-coded cluster size? HOT 5
- help bro my issue = warn: Problem when checking for new versions of RethinkDB: HTTP request to update.rethinkdb.com failed. HOT 1
- cluster connect/reconnect timeout HOT 1
- Installation fails in Kubuntu 23.10 HOT 4
- Generate web_assets.cc in a repeatable file order HOT 1
- Avoid full paths of coffeescript files in generation of web_assets.cc HOT 2
- Rethinkdb 2.4.4 release list HOT 11
- Support protobuf 25
- Return multiple changes feed
- Cache miss rate measurements HOT 4
- Something i forgot to had when having the default doc like so
- Connect rethinkdb directly from browser ? HOT 1
- Why exactly do rethinkDB add null characters to response / request JSON ? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rethinkdb.