On 11 Apr 2017, at 4:06pm, Richard Hipp <[email protected]> wrote:

> SQLITE_IOERR_VNODE is an error code used by proprietary modifications
> to SQLite implemented by Apple for use on MacOS and iOS.  I am told
> "The code indicates that a file relevant to the call was invalidated
> by a dispatch vnode source event" but I do not understand what that
> means.

I’m not surprised.  That’s not a useful explanation for anyone who isn’t 
messing with the OS X Virtual File System.  I’m a Mac expert and I have only 
the vaguest clue.  I think Apple is trying to implement memory-mapped file 
handling for SQLite in a very direct and efficient manner, and a strange 
combination of circumstances is triggering an error.

We're used to inodes in file storage.  Apple uses vnodes as well as inodes.  
They’re for storing a file’s metadata, like the file’s name and the last time 
the file was accessed.  If you change metadata VFS might decide to overwrite 
the contents of the existing vnode, or it might write the new data to a new 
vnode, then switch the file’s pointer to the new one and dispose of the old one.

What I think you’re being told is that you’re referring to a file, VFS is 
remembering the reference by pointing to the vnode, but that the file now has a 
new vnode because it has new metadata.  I have no clue why that might happen.  
vnodes are meant to be for internal use only.  If you’re not intentionally 
messing with them, you shouldn’t be getting vnode errors.

The nearest I can find is Working With the File System from

<https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/Filesystem/Filesystem.html>

and then

<https://developer.apple.com/library/content/documentation/Networking/Conceptual/AFP/AFPClientCaching/AFPClientCaching.html#//apple_ref/doc/uid/TP40000854-CH231-SW3>

There is one common use for vnodes: memory-mapped files.  The vnode pager 
maintains the relationship between the memory copy of a page of a file and the 
disk copy of the same page of the file.  So perhaps that piece of code is 
intentionally messing with memory-mapped file access.  Again, there’s no good 
reason for you to be getting errors with vnodes unless you’re messing at kernel 
level.

ObDisc: I am not familiar with this stuff.  I don’t program Macs at kernel 
level and don’t understand how it all works.  I’m just remembering stuff I read 
somewhere, possibly now obsolete.

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to