[ http://issues.apache.org/jira/browse/DERBY-555?page=all ]
Øystein Grøvlen updated DERBY-555:
----------------------------------
Attachment: derby-555.diff
I have attached a patch that aims to resolve this issue as follows:
- If database is set to read-only, print a message in derby.log about this.
- If the database is read-only, do not worry about log path. This avoids the
null pointer exception.
The following files are changed:
M java/engine/org/apache/derby/impl/store/raw/RawStore.java
M java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
M java/engine/org/apache/derby/iapi/reference/MessageId.java
M java/engine/org/apache/derby/loc/messages_en.properties
If this fix is applied, the database will boot in read-only mode if there is
not free disk space in the database directory. A message of this will then be
printed to derby.log. This is far from an ideal solution since an application
that experience this will not get any warning/error when connecting. However,
if it laters tries to modify data, it will get exceptions like "ERROR 25502: An
SQL data change is not permitted for a read-only connection, user or database".
I think many Derby users will be confused by this message since I am not sure
the aspects of read-only connections/users/databases are well known to most
Derby users.
I guess the documentation should be updated to inform about this, but I am not
quite sure where to put it. Any suggestions?
I have not made any tests for this. Do people think it is necessary? It is a
bit difficult to make a standard test that fills disk devices. I could
experiment to see if I can get the same NPE problem with a read-only database.
> Unable to restart after disk is full
> ------------------------------------
>
> Key: DERBY-555
> URL: http://issues.apache.org/jira/browse/DERBY-555
> Project: Derby
> Type: Bug
> Components: Store
> Versions: 10.2.0.0
> Environment: Sun Sparc Solaris, 1.4 JDK, Derby Client/Server
> Reporter: Øystein Grøvlen
> Assignee: Øystein Grøvlen
> Priority: Critical
> Attachments: derby-555.diff
>
> 1. Inserted data into the database until the disk was full. (5 clients
> inserting into 5 different tables in parallel.)
> 2. Shut down the server
> 3. Start the database again without freeing any disk space.
> When I try to start the database again, I get Null-pointer-exception,
> regardless of how I connect (have tried embedded, client server, ij, jdbc
> applications). I have not tried to free some space on the disk before
> starting.
> The call stack is not available right now (the computer I used had to be shut
> down due to problems with our cooling system), but the exception comes from
> the following line in RawStore.java:
> properties.put(Attribute.LOG_DEVICE, logFactory.getCanonicalLogPath());
> getCanonicalLogPath() returns null which results in a NPE in the hash table.
> A quick debug before the computer was stopped, showed that the logFactory was
> an instance of org.apache.derby.impl.store.raw.log.ReadOnly which always
> returns null in its getCanonicalLogPath().
> I suspect this may be related to the fact that I ran with the log in a
> non-default location.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira