Package org.exist.storage.journal

Examples of org.exist.storage.journal.LogException


       // TODO: do we need to redo?  The file was stored...
    }
   
    public void undo() throws LogException {
       if (!original.delete()) {
          throw new LogException("Cannot delete binary resource "+original);
       }
    }
View Full Code Here


                node.pageHeader.setLsn(loggable.getLsn());
                node.pageHeader.parentPage = loggable.parentNum;
                final int increment = node.pageHeader.getStatus() == BRANCH ? 2 : 1;
                cache.add(node, increment);
            } catch (final IOException e) {
                throw new LogException(e.getMessage(), e);
            }
        }
    }
View Full Code Here

                } catch (final Exception e) {
                    LOG.warn(e);
                    e.printStackTrace();
                }
                LOG.warn(writer.toString());
                throw new LogException("Critical error during recovery");
            }
            node.ptrs[loggable.idx] = loggable.pointer;
            node.pageHeader.setLsn(loggable.getLsn());
            node.saved = false;
        }
View Full Code Here

            } catch (final Exception e) {
                LOG.error("Exception caught while redoing transactions. Aborting recovery to avoid possible damage. " +
                    "Before starting again, make sure to run a check via the emergency export tool.", e);
                if (next != null)
                    {LOG.info("Log entry that caused the exception: " + next.dump());}
                throw new LogException("Recovery aborted. ");
            } finally {
                LOG.info("Redo processed " + redoCnt + " out of " + txnCount + " transactions.");
            }

            // ------- UNDO ---------
            if (LOG.isInfoEnabled())
                {LOG.info("Second pass: undoing dirty transactions. Uncommitted transactions: " +
                        runningTxns.size());}
            // see if there are uncommitted transactions pending
            if (runningTxns.size() > 0) {
                // do a reverse scan of the log, undoing all uncommitted transactions
                try {
                    while((next = reader.previousEntry()) != null) {
                        if (next.getLogType() == LogEntryTypes.TXN_START) {
                            if (runningTxns.get(next.getTransactionId()) != null) {
                                runningTxns.remove(next.getTransactionId());
                                if (runningTxns.size() == 0)
                                    // all dirty transactions undone
                                    {break;}
                            }
                        } else if (next.getLogType() == LogEntryTypes.TXN_COMMIT) {
                            // ignore already committed transaction
                        } else if (next.getLogType() == LogEntryTypes.CHECKPOINT) {
                            // found last checkpoint: undo is completed
                            break;
                        }

                        // undo the log entry if it belongs to an uncommitted transaction
                        if (runningTxns.get(next.getTransactionId()) != null) {
    //          LOG.debug("Undo: " + next.dump());
                            next.undo();
                        }
                    }
                } catch (final Exception e) {
                    LOG.warn("Exception caught while undoing dirty transactions. Remaining transactions " +
                            "to be undone: " + runningTxns.size() + ". Aborting recovery to avoid possible damage. " +
                            "Before starting again, make sure to run a check via the emergency export tool.", e);
                    if (next != null)
                        {LOG.warn("Log entry that caused the exception: " + next.dump());}
                    throw new LogException("Recovery aborted");
                }
            }
        } finally {
            broker.sync(Sync.MAJOR_SYNC);
            logManager.setInRecovery(false);
View Full Code Here

    }
   
    public void undo() throws LogException {
       LOG.debug("Undo rename: "+original);
       if (!backup.renameTo(original)) {
          throw new LogException("Cannot move original "+original+" to backup file "+backup);
       }
    }
View Full Code Here

TOP

Related Classes of org.exist.storage.journal.LogException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.