You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Alex Karasulu (JIRA)" <di...@incubator.apache.org> on 2004/12/02 18:48:24 UTC

[jira] Created: (DIREVE-92) Add JVM shutdown hook to prevent loss of caches before next flush

Add JVM shutdown hook to prevent loss of caches before next flush
-----------------------------------------------------------------

         Key: DIREVE-92
         URL: http://nagoya.apache.org/jira/browse/DIREVE-92
     Project: Directory Eve
        Type: Bug
  Components: eve  
    Reporter: Alex Karasulu
 Assigned to: Alex Karasulu 


Looks like you can loose data if you shutdown the server after writing to it if you shutdown before a sync operation.  This is similar to the buffer cache idea.  At this point all writes are not persisted until a sync or buffers fill.  We will have the option later to use ACID transactions for perisiting on each write.  This is slower but safer.

For now we just need a JVM hook to sync on shutdown.  This way all caches get flushed to disk before terminating when signals are trapped.  Gotta figure out how to do this.  Phoenix did this nicely.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-92) Add JVM shutdown hook to prevent loss of cached entries

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DIREVE-92?page=history ]

Alex Karasulu updated DIREVE-92:
--------------------------------

    Summary: Add JVM shutdown hook to prevent loss of cached entries  (was: Add JVM shutdown hook to prevent loss of caches before next flush)

> Add JVM shutdown hook to prevent loss of cached entries
> -------------------------------------------------------
>
>          Key: DIREVE-92
>          URL: http://nagoya.apache.org/jira/browse/DIREVE-92
>      Project: Directory Eve
>         Type: Bug
>   Components: eve
>     Reporter: Alex Karasulu
>     Assignee: Alex Karasulu
>      Fix For: 0.8.0

>
> Looks like you can loose data if you shutdown the server after writing to it if you shutdown before a sync operation.  This is similar to the buffer cache idea.  At this point all writes are not persisted until a sync or buffers fill.  We will have the option later to use ACID transactions for perisiting on each write.  This is slower but safer.
> For now we just need a JVM hook to sync on shutdown.  This way all caches get flushed to disk before terminating when signals are trapped.  Gotta figure out how to do this.  Phoenix did this nicely.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-92) Add JVM shutdown hook to prevent loss of caches before next flush

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DIREVE-92?page=history ]

Alex Karasulu updated DIREVE-92:
--------------------------------

    Fix Version: 0.8.0

> Add JVM shutdown hook to prevent loss of caches before next flush
> -----------------------------------------------------------------
>
>          Key: DIREVE-92
>          URL: http://nagoya.apache.org/jira/browse/DIREVE-92
>      Project: Directory Eve
>         Type: Bug
>   Components: eve
>     Reporter: Alex Karasulu
>     Assignee: Alex Karasulu
>      Fix For: 0.8.0

>
> Looks like you can loose data if you shutdown the server after writing to it if you shutdown before a sync operation.  This is similar to the buffer cache idea.  At this point all writes are not persisted until a sync or buffers fill.  We will have the option later to use ACID transactions for perisiting on each write.  This is slower but safer.
> For now we just need a JVM hook to sync on shutdown.  This way all caches get flushed to disk before terminating when signals are trapped.  Gotta figure out how to do this.  Phoenix did this nicely.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DIREVE-92) Add JVM shutdown hook to prevent loss of cached entries

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DIREVE-92?page=history ]
     
Alex Karasulu closed DIREVE-92:
-------------------------------

    Resolution: Fixed

I added the hook registration easily enough to the constructor of the RootNexus.  This was the approach I took because it only requires one hook registration to force the sync and close of all backing stores via the root's close() method.  That way I don't have to waste a hook thread for each partition backing store in the system.  I tested this all out and it works like a champion.

While in the code I made the sync() and close() operations NOT fail fast.  Meaning they don't blow chunks when they get an exception on a sync() or close() operation right when the operation fails.  Instead the loop catches the exception holds a reference to it and then continues forward to give all backing stores a chance before failing.  Then at the end the exceptions are thrown using a MultiException which holds all collected exceptions.

I did this and now I'm finding out that sync ops are failing.  I will file another JIRA bug with this since this problem is unrelated to this issue.

The changes for this were committed in revision 109696 here:

   http://svn.apache.org/viewcvs.cgi?rev=109696&view=rev


> Add JVM shutdown hook to prevent loss of cached entries
> -------------------------------------------------------
>
>          Key: DIREVE-92
>          URL: http://nagoya.apache.org/jira/browse/DIREVE-92
>      Project: Directory Eve
>         Type: Bug
>   Components: eve
>     Reporter: Alex Karasulu
>     Assignee: Alex Karasulu
>      Fix For: 0.8.0

>
> Looks like you can loose data if you shutdown the server after writing to it if you shutdown before a sync operation.  This is similar to the buffer cache idea.  At this point all writes are not persisted until a sync or buffers fill.  We will have the option later to use ACID transactions for perisiting on each write.  This is slower but safer.
> For now we just need a JVM hook to sync on shutdown.  This way all caches get flushed to disk before terminating when signals are trapped.  Gotta figure out how to do this.  Phoenix did this nicely.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-92) Add JVM shutdown hook to prevent loss of cached entries

Posted by "Niclas Hedhman (JIRA)" <di...@incubator.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DIREVE-92?page=comments#action_56136 ]
     
Niclas Hedhman commented on DIREVE-92:
--------------------------------------

Since you can have more than one hook in the JVM, I would suggest that each subsystem that needs to deal with that condition adds it own hook.
    Runtime.getRuntime().addShutdownHook( hook );
where hook is a java.lang.Thread containing the code to be run upon shutdown.

> Add JVM shutdown hook to prevent loss of cached entries
> -------------------------------------------------------
>
>          Key: DIREVE-92
>          URL: http://nagoya.apache.org/jira/browse/DIREVE-92
>      Project: Directory Eve
>         Type: Bug
>   Components: eve
>     Reporter: Alex Karasulu
>     Assignee: Alex Karasulu
>      Fix For: 0.8.0

>
> Looks like you can loose data if you shutdown the server after writing to it if you shutdown before a sync operation.  This is similar to the buffer cache idea.  At this point all writes are not persisted until a sync or buffers fill.  We will have the option later to use ACID transactions for perisiting on each write.  This is slower but safer.
> For now we just need a JVM hook to sync on shutdown.  This way all caches get flushed to disk before terminating when signals are trapped.  Gotta figure out how to do this.  Phoenix did this nicely.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira