dbTalk Databases Forums  

env->open() with DB_CREATE and with little diskspace

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss env->open() with DB_CREATE and with little diskspace in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andi Vajda
 
Posts: n/a

Default env->open() with DB_CREATE and with little diskspace - 01-09-2006 , 08:19 PM






When creating a new environment on a hard drive with insufficient free
disk space, the error code returned seems to be DB_RUNRECOVERY.
Wouldn't it make more sense to return ENOSPC ?

Andi..


Reply With Quote
  #2  
Old   
Andi Vajda
 
Posts: n/a

Default Re: env->open() with DB_CREATE and with little diskspace - 01-09-2006 , 08:21 PM






I forgot to mention that this is running Berkeley DB 4.4.16 on Mac OS X
10.4.3.

Andi..


Reply With Quote
  #3  
Old   
Ron
 
Posts: n/a

Default Re: env->open() with DB_CREATE and with little diskspace - 01-10-2006 , 10:04 AM



Hi Andi

We don't want applications to have to interpret and handle every
possible error that could be returned by the system, so we aggregate
those errors into classes of failure -- in this case, "panic", or
DB_RUNRECOVERY.

Regards,
Ron


Reply With Quote
  #4  
Old   
Andi Vajda
 
Posts: n/a

Default Re: env->open() with DB_CREATE and with little diskspace - 01-10-2006 , 03:06 PM



Ron wrote:
Quote:
Hi Andi

We don't want applications to have to interpret and handle every
possible error that could be returned by the system, so we aggregate
those errors into classes of failure -- in this case, "panic", or
DB_RUNRECOVERY.

Regards,
Ron
Well, I sure expect to know why something fails when the disk is full.
As a matter of fact db->put() will fail with ENOSPC in that situation.
Given that ENOSPC is returned by some APIs (good), I'd love it for all
APIs that can fail that way to consistently return it.
When creating the environment, typically after our application is first
installed, I need to be able to report to the end user that their disk
is full as opposed to telling them 'panic', "run recovery".
I cannot check disk space after the fact because the disk is actually
not full because the file creation filling it failed.
The only heuristic I can come up with is to verify that the env files
are not there (or some missing) and then 'guess' that they couldn't be
created because of a full disk. If Berkeley DB knows the actual reason
for failure, I sure want it to tell me instead if having me try to
figure it out after the fact using uncertain, brittle, heuristics.

Thanks

Andi..



Reply With Quote
  #5  
Old   
Ron
 
Posts: n/a

Default Re: env->open() with DB_CREATE and with little diskspace - 01-11-2006 , 08:01 AM



Are you running with verbose error messages turned on?

Ron


Reply With Quote
  #6  
Old   
Andi Vajda
 
Posts: n/a

Default Re: env->open() with DB_CREATE and with little diskspace - 01-13-2006 , 12:00 PM



Ron wrote:
Quote:
Are you running with verbose error messages turned on?
No, how would I do that ?

I only interpret the error code returned as an int to me from the C
API.
env->open() is not documented to return ENOSPC.

Andi..



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.