db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5766) BaseDataFileFactory.boot() should log the exception that causes it to boot the database read only
Date Sun, 20 May 2012 20:50:41 GMT

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

Kathey Marsden commented on DERBY-5766:
---------------------------------------

I am not quite done with this issue and want to get review so it won't make RC1 for 10.9.
Since it will only add additional logging information when the database is booted read only
due to an unwritable lock file and won't prevent the boot.  I think it can be safely backported
after the branch. This shouldn't hold up the release.
 
                
> BaseDataFileFactory.boot() should log the exception that causes it to boot the database
read only 
> --------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5766
>                 URL: https://issues.apache.org/jira/browse/DERBY-5766
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.9.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>
> In BaseDataFileFactory.boot() there is code that tries to write to the lock file. If
it cannot, and gets an IOException  it assumes the database is read only.  I think that we
should log that the database is booting read only and why and if it is not specifically a
permission error log the exception stack trace.
>  
>            fileLockOnDB = fileLock.getRandomAccessFile( "rw");
>             fileLock.limitAccessToOwner();
>             // write it out for future reference
>             fileLockOnDB.writeUTF(myUUID.toString()); 
>             fileLockOnDB.sync();
>             fileLockOnDB.seek(0);
>             // check the UUID
>             UUID checkUUID = uuidFactory.recreateUUID(fileLockOnDB.readUTF());
>             if (!checkUUID.equals(myUUID))
>             {
>                 throw StandardException.newException(
>                     SQLState.DATA_MULTIPLE_JBMS_ON_DB, databaseDirectory);
>             }
>         }
>         catch (IOException ioe)
>         {
>             // probably a read only db, don't do anything more
>             readOnly = true;
>             try
>             {
>                 if (fileLockOnDB != null)
>                     fileLockOnDB.close();
>             }
>             catch (IOException ioe2)
>             { /* did the best I could */ }
>             fileLockOnDB = null;
>             return;
>         }
> I think this code can be exercised by creating a database and exiting without shutdown.
Then change permission on the db.lck  and dbex.lck files. It occurs often in the field when
multiple users with incompatible permissions/umasks access the derby database.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message