mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.3-BUG-FIX to HEAD
23080: Fix for ALF-3815 - Error occur on creating user (Active Directory +LDAP authentication) 23084: MERGED DEV to V3.3-BUG-FIX 22839 : ALF-4920 - IMAP server UID failure 23102: Checked in file with my Hostname! 23141: Merged PATCHES/V3.2.0 to V3.3-BUG-FIX 22977: ALF-5057: Don't use lucene to locate tag nodes - unreliable in a cluster - CategoryService extended with root category retrieval method using node service 23043: ALF-5057: Merged V3.2 to PATCHES/V3.2.0 (partial) 18052: Merged DEV/REPO-DOCLIB to V3.2 17653: Checkpoint Repo DocLib prototype work 23142: Merged PATCHES/V3.2.0 to V3.3-BUG-FIX 22981: ALF-5141: Need to limit webscript response times and reject traffic at high load - server.web.transaction.max-duration-ms property now specifies a maximum time for repository webscript transaction execution. Default is 10 seconds. - transaction retrying will not continue when the projected time is greater than this - Once a transaction hits this execution time the number of concurrently executing transactions at the time it was started becomes the ‘ceiling’ for the number of concurrent transactions - The ceiling will dynamically rise and fall, based on transaction execution times - When a transaction is started ‘above’ the current ceiling a TooBusyException is thrown, which is mapped to an immediate status 503 response - New unit test added for this 23006: ALF-5141: Reverting IndexInfo changes - 'fairness' flag on ReentrantReadWriteLock appears to cause deadlock on JDK 1.5 in IndexInfoTest - lucene.indexer.maxMergeWait property and associated throttling 'back off' behaviour abandoned as it has the risk of leaving indexes in incomplete uncommited state - transaction limiter feature should be enough to avoid excessive wait times 23011: ALF-5141: Reintroduce fair locking to IndexInfo and fix RetryingTransactionHelperTest - Bugs surrounding ReentrantReadWriteLock in old JVMs mean that it's not safe to make fair locking the default - However, it would be useful in new JVMs as it should guarantee that we don't lock out waiting writers indefinitely under high load - Now controlled by lucene.indexer.fairLocking property. Default value is false in V3.2.0 but true in V3.3.4 onwards. - RetryingTransactionHelperTest now uses latches to ensure test threads start up in strict sequential order 23014: ALF-5141: Correct error that could allow transaction ceiling to be lowered to zero 23146: (RECORD ONLY) ALF-5028: Merged HEAD to V3.3-BUG-FIX 21471: SAIL-240 (SAIL-294) AuditDAO: AuditService enhancements - Added isAuditEnabled and enableAudit for global case (system-wide) - Some neatening up of Audit SQL (common WHERE and ORDER BY clauses) - AuditService enforces 'admin' role for all methods 22109: ALF-4106: Added entry deletion count return value for clear() 22726: Coding standards 22857: Fix typo in javadoc 22980: Added AuditService.clearAudit(List<Long>) 22986: ALF-5028 - Tagging Service Update - Use the audit service as a persisted event log, so that tag scope updates can occur in batches and without contention issues. (Further tests and post-startup executor still needed) This commit enables the Audit Service by default, but turns off all the audit applications except tagging by default, so there shouldn't be any noticable changes 22997: ALF-5028 - More tag scope updates and unit tests. Shortly after the system is started, check for un-applied tag scope updates, and apply them. 23015: ALF-5028: Tagging test mods - Join onto first-level threads to be sure that first round of tagging has been done - Double-checks for transaction leaks (found 1) - Some formatting (new test only, but should be applied to file) 23148: Merged PATCHES/V3.2.0 to V3.3-BUG-FIX 23133: ALF-5221: Fixed file handle leaks in TaggingService 23149: Merged V3.2 to V3.3-BUG-FIX 23070: Part-fix ALF-5134: Performance of Alfresco cluster less than performance of single node - Prevent cache being updated even when there are no changes - Prevents some cache invalidation messages during read operations 23071: ALF-5134: Performance of Alfresco cluster less than performance of single node - Removed null-equivalence check in TransactionalCache - Avoids cache update messages when running against empty caches 23150: (RECORD ONLY) ALF-5235: Merged HEAD to V3.3-BUG-FIX 22695: ALF-3800 "File is uploaded to the Document Library when its size more than user quota": make sure the exception is thrown back up to the transaction machinery to perform a rollback 23156: Merged V3.3 to V3.3-BUG-FIX 22913: Add jars back into Tomcat bundles 23028: Merged DEV to V33: 23022: ALF-4760 : XAM post-retention cleanup job: XAMArchiveJob 1. Post-retention xam cleanup job was implemented according to requirements provided by Derek. 2. Unit tests was added for new functionality. 23125: Merged HEAD to V3.3 20752: BatchProcessor is fed work by a BatchProcessWorkProvider 22297: Fixed ALF-4676: WorkProviderIterator over BatchProcessWorkProvider does not fetch all results 23126: (RECORD ONLY) Merged BRANCHES/DEV/V3.3-BUG-FIX to BRANCHES/V3.3: 22883: ALF-4800 - AVM - intermittent test failure (layered file delete) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23161 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,11 +27,10 @@ import javax.transaction.UserTransaction;
|
||||
import junit.framework.TestCase;
|
||||
import net.sf.ehcache.CacheManager;
|
||||
|
||||
import org.alfresco.repo.cache.TransactionalCache.NullValueMarker;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
@@ -206,9 +205,9 @@ public class CacheTest extends TestCase
|
||||
// update 3 in the cache
|
||||
transactionalCache.put(UPDATE_TXN_THREE, "XXX");
|
||||
assertEquals("Item not updated in txn cache", "XXX", transactionalCache.get(UPDATE_TXN_THREE));
|
||||
assertFalse("Item was put into backing cache (excl. NullValueMarker)",
|
||||
backingCache.contains(UPDATE_TXN_THREE) &&
|
||||
!(backingCache.get(UPDATE_TXN_THREE) instanceof NullValueMarker));
|
||||
assertFalse(
|
||||
"Item was put into backing cache (excl. NullValueMarker)",
|
||||
backingCache.contains(UPDATE_TXN_THREE));
|
||||
|
||||
// check that the keys collection is correct
|
||||
Collection<String> transactionalKeys = transactionalCache.getKeys();
|
||||
@@ -597,7 +596,7 @@ public class CacheTest extends TestCase
|
||||
return null;
|
||||
}
|
||||
};
|
||||
executeAndCheck(callback, COMMON_KEY, null);
|
||||
executeAndCheck(callback, COMMON_KEY, "AAA"); // Relaxed for ALF-5134
|
||||
}
|
||||
/**
|
||||
* <ul>
|
||||
|
@@ -249,7 +249,7 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a value from the shared cache, checking for {@link NullValueMarker null markers}.
|
||||
* Fetches a value from the shared cache.
|
||||
*
|
||||
* @param key the key
|
||||
* @return Returns the value or <tt>null</tt>
|
||||
@@ -257,16 +257,7 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
@SuppressWarnings("unchecked")
|
||||
private V getSharedCacheValue(K key)
|
||||
{
|
||||
Object valueObj = sharedCache.get(key);
|
||||
if (valueObj instanceof NullValueMarker)
|
||||
{
|
||||
// Someone has already marked this as a null
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (V) valueObj;
|
||||
}
|
||||
return (V) sharedCache.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -413,16 +404,13 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
CacheBucket<V> bucket = null;
|
||||
if (existingValueObj == null)
|
||||
{
|
||||
// Insert a 'null' marker into the shared cache
|
||||
NullValueMarker nullMarker = new NullValueMarker();
|
||||
sharedCache.put(key, nullMarker);
|
||||
// ALF-5134: Performance of Alfresco cluster less than performance of single node
|
||||
// The 'null' marker that used to be inserted also triggered an update in the afterCommit
|
||||
// phase; the update triggered cache invalidation in the cluster. Now, the null cannot
|
||||
// be verified to be the same null - there is no null equivalence
|
||||
//
|
||||
// The value didn't exist before
|
||||
bucket = new NewCacheBucket<V>(nullMarker, value);
|
||||
}
|
||||
else if (existingValueObj instanceof NullValueMarker)
|
||||
{
|
||||
// Record the null as is
|
||||
bucket = new NewCacheBucket<V>((NullValueMarker)existingValueObj, value);
|
||||
bucket = new NewCacheBucket<V>(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -698,17 +686,6 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
txnData.isClosed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instances of this class are used to mark the shared cache null values for cases where
|
||||
* new values are going to be inserted into it.
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public static class NullValueMarker implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -8384777298845693563L;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for the transactional cache buckets. These hold the actual values along
|
||||
* with some state and behaviour around writing from the in-transaction caches to the
|
||||
@@ -733,7 +710,6 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
|
||||
/**
|
||||
* A bucket class to hold values for the caches.<br/>
|
||||
* The cache assumes the presence of a marker object to
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
@@ -742,11 +718,9 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
private static final long serialVersionUID = -8536386687213957425L;
|
||||
|
||||
private final BV value;
|
||||
private final NullValueMarker nullMarker;
|
||||
public NewCacheBucket(NullValueMarker nullMarker, BV value)
|
||||
public NewCacheBucket(BV value)
|
||||
{
|
||||
this.value = value;
|
||||
this.nullMarker = nullMarker;
|
||||
}
|
||||
public BV getValue()
|
||||
{
|
||||
@@ -757,20 +731,13 @@ public class TransactionalCache<K extends Serializable, V extends Object>
|
||||
Object sharedValue = sharedCache.get(key);
|
||||
if (sharedValue != null)
|
||||
{
|
||||
if (sharedValue == nullMarker)
|
||||
{
|
||||
// The shared cache entry didn't change during the txn and is safe for writing
|
||||
sharedCache.put(key, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The shared value has moved on since
|
||||
sharedCache.remove(key);
|
||||
}
|
||||
// A value was added during the txn
|
||||
sharedCache.remove(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The shared cache no longer has a value
|
||||
// The shared cache value is still null (it might have changed a few times, though) so write
|
||||
sharedCache.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user