db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Mckenzie (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4589) Corrupted database prevents startup and should be automatically repaired perhaps
Date Wed, 24 Mar 2010 19:07:27 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849361#action_12849361
] 

Jeff Mckenzie commented on DERBY-4589:
--------------------------------------

If it is possible to determine that the database is half-created, then
either option 1 or 2 would be good. Otherwise, your app must make a guess.
At the moment my app renames the database to DB_NAME_corrupted, and carries
on making a new database (but it has no way of knowing whether there was any
data in the corrupted database, and no way of recovering it).

In any case the current behaviour (driver says the DB does not exist, and
then fails to create a new one), is not really correct. At least it should
know that there is a partially created database so the app can do something
about it, and is not guessing.

The main issue is that Derby should tell you whether there is any data in
the database, or that it is just a half-created database. I suppose writing
a creation completed flag to the database somewhere would be helpful.
Database creation should be atomic like a transaction - all or nothing. If
that creation completed flag is missing on next startup, then Derby could
safely assume that the creation was not completed and finish it off or
rebuild the DB from scratch. I'd favour option 1, because it gives the app
the chance to cancel the operation.

I've only encountered one other corrupt database, but that one had 20 MB of
data in it. All other problems I've seen were related to this DB creation
issue.

Thanks for your comments.




> Corrupted database prevents startup and should be automatically repaired perhaps
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-4589
>                 URL: https://issues.apache.org/jira/browse/DERBY-4589
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.3.0
>         Environment: Windows 2000, SP4. J2SE 1.6
>            Reporter: Jeff Mckenzie
>         Attachments: 2010-03.zip
>
>
> I have found a database in my application that prevents startup due to it being corrupted.

> The driver reports that the database does not exist, even though it does. Then when my
app tries to create the database using ;create=true; on the URL it fails.
> I think this happened due to the app being killed in Task Manager while it was creating
the database.
> I have the database saved so that you can reproduce the problem. (I'm not sure if I can
attach it yet)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message