Quantcast

What does SQLITE_IOERR_VNODE mean?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

What does SQLITE_IOERR_VNODE mean?

Yf Shen
We have an application that connects to a small SQLite database in
read-only mode and do some very simple SELECT queries.

We recently upgraded Mac OS to 10.12, and the application started to
sporadically fail with a general (useless) error code SQLITE_IOERR. We
managed to get the extended error code SQLITE_IOERR_VNODE (6922), but could
not find any documentation about it or find where it is used in the source
code of SQLite except that we found where it was defined. Google knows
nothing about this error either probably because it is brand new. Can
someone shed some light?

Thanks,
Yufei
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What does SQLITE_IOERR_VNODE mean?

Richard Hipp-3
On 4/11/17, Yf Shen <[hidden email]> wrote:

> We have an application that connects to a small SQLite database in
> read-only mode and do some very simple SELECT queries.
>
> We recently upgraded Mac OS to 10.12, and the application started to
> sporadically fail with a general (useless) error code SQLITE_IOERR. We
> managed to get the extended error code SQLITE_IOERR_VNODE (6922), but could
> not find any documentation about it or find where it is used in the source
> code of SQLite except that we found where it was defined. Google knows
> nothing about this error either probably because it is brand new. Can
> someone shed some light?

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.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What does SQLITE_IOERR_VNODE mean?

Simon Slavin-3

On 11 Apr 2017, at 4:06pm, Richard Hipp <[hidden email]> 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
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What does SQLITE_IOERR_VNODE mean?

Jens Alfke-2
Apple's darwin-dev mailing list, hosted at lists.apple.com <http://lists.apple.com/>, might be a good place to ask about this.
(I'm subscribed to it, so I could forward a question if the OP doesn't want to go to the bother of subscribing.)

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...