Merged V3.2 to HEAD

19432: Merged V3.1 to V3.2
        19427: Merged V3.0 to V3.1
            19423: Merged V2.2 to V3.0
                19391: Fix for ALF-2076: AUTO does not work if a document has been added and deleted since the index backup
                19419: V2.2 Build Fix
                19421: Fix for ALF-2076: AUTO does not work if a document has been added and deleted since the index backup


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19434 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2010-03-20 16:55:20 +00:00
parent 783ce15a2c
commit f8852e3631
4 changed files with 216 additions and 38 deletions

View File

@@ -369,15 +369,16 @@ public abstract class AbstractReindexComponent implements IndexRecovery
return storeRefs;
}
protected InIndex isTxnIdPresentInIndex(long txnId)
{
Transaction txn = nodeDaoService.getTxnById(txnId);
if (txn == null)
{
return InIndex.YES;
}
return isTxnPresentInIndex(txn);
}
// Unused - comemnted out to make use clearer for isTxnPresentInIndex
// protected InIndex isTxnIdPresentInIndex(long txnId)
// {
// Transaction txn = nodeDaoService.getTxnById(txnId);
// if (txn == null)
// {
// return InIndex.YES;
// }
// return isTxnPresentInIndex(txn);
// }
/**
* Determines if a given transaction is definitely in the index or not.
@@ -463,13 +464,16 @@ public abstract class AbstractReindexComponent implements IndexRecovery
{
// There are no updates or deletes and no entry in the indexes.
// There are outdated nodes in the index.
result = InIndex.YES;
result = InIndex.INDETERMINATE;
}
else
{
// There were deleted nodes only. Check that all the deleted nodes were
// removed from the index otherwise it is out of date.
result = InIndex.YES;
// If all nodes have been removed from the index then the result is that the index is OK
// ETWOTWO-1387
// ALF-1989 - even if the nodes have not been found it is no good to use for AUTO index checking
result = InIndex.INDETERMINATE;
for (StoreRef storeRef : storeRefs)
{
if (!haveNodesBeenRemovedFromIndex(storeRef, txn))
@@ -635,22 +639,6 @@ public abstract class AbstractReindexComponent implements IndexRecovery
return !foundNodeRef;
}
/**
* @return Returns <tt>false</tt> if any one of the transactions aren't in the index.
*/
protected boolean areTxnsInIndex(List<Transaction> txns)
{
for (Transaction txn : txns)
{
if (isTxnPresentInIndex(txn) == InIndex.NO)
{
// Missing txn
return false;
}
}
return true;
}
/**
* Marker exception to neatly handle VM-driven termination of a reindex
*