[teiid-commits] teiid SVN: r4631 - in branches/7.7.x: engine/src/main/java/org/teiid/common/buffer/impl and 1 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Apr 16 14:26:12 EDT 2014


Author: jolee
Date: 2014-04-16 14:26:12 -0400 (Wed, 16 Apr 2014)
New Revision: 4631

Modified:
   branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java
   branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
   branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
   branches/7.7.x/engine/src/main/resources/org/teiid/query/i18n.properties
Log:
TEIID-2636: Stream corruption errors when doing big query, logging changes only

Modified: branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java	2014-04-16 15:26:45 UTC (rev 4630)
+++ branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java	2014-04-16 18:26:12 UTC (rev 4631)
@@ -592,7 +592,7 @@
 	                            break objectSearch;
 	                        }
 	                    }
-	                    throw new TeiidRuntimeException(JDBCPlugin.Util.getString("BatchSerializer.datatype_mismatch", new Object[] {types[i], new Integer(i), objectClass})); //$NON-NLS-1$
+	                    throw new TeiidRuntimeException(e, JDBCPlugin.Util.getString("BatchSerializer.datatype_mismatch", new Object[] {types[i], new Integer(i), objectClass})); //$NON-NLS-1$
 	                }
 	            }
             }

Modified: branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java	2014-04-16 15:26:45 UTC (rev 4630)
+++ branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java	2014-04-16 18:26:12 UTC (rev 4631)
@@ -676,9 +676,9 @@
 				//entries are mutable after adding, the original should be removed shortly so just ignore
 				LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Object "+ entry.getId() +" changed size since first persistence, keeping the original."); //$NON-NLS-1$ //$NON-NLS-2$
 			} else if (e == BlockOutputStream.exceededMax){
-				LogManager.logError(LogConstants.CTX_BUFFER_MGR, "Max block number exceeded.  Increase the maxStorageObjectSize to support larger storage objects.  Alternatively you could make the processor batch size smaller."); //$NON-NLS-1$
+				LogManager.logError(LogConstants.CTX_BUFFER_MGR, "Max block number exceeded " + s.getId() + " " + entry.getId() + " Increase the maxStorageObjectSize to support larger storage objects.  Alternatively you could make the processor batch size smaller."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			} else {
-				LogManager.logError(LogConstants.CTX_BUFFER_MGR, e, "Error persisting, attempts to read "+ entry.getId() +" later will result in an exception."); //$NON-NLS-1$ //$NON-NLS-2$
+				LogManager.logError(LogConstants.CTX_BUFFER_MGR, e, "Error persisting, attempts to read " + s.getId() + " " + entry.getId() +" later will result in an exception."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			}
 		} finally {
 			if (hasPermit) {
@@ -789,9 +789,9 @@
 			CacheEntry ce = new CacheEntry(new CacheKey(oid, 1, 1), sizeEstimate, serializer.deserialize(dis), ref, true);
 			return ce;
         } catch(IOException e) {
-        	throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", oid)); //$NON-NLS-1$
+        	throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", info.gid, oid)); //$NON-NLS-1$
         } catch (ClassNotFoundException e) {
-        	throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", oid)); //$NON-NLS-1$
+        	throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", info.gid, oid)); //$NON-NLS-1$
         } catch (InterruptedException e) {
         	throw new TeiidRuntimeException(e);
 		} finally {

Modified: branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java	2014-04-16 15:26:45 UTC (rev 4630)
+++ branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java	2014-04-16 18:26:12 UTC (rev 4631)
@@ -48,6 +48,7 @@
 
 import org.teiid.client.BatchSerializer;
 import org.teiid.client.ResizingArrayList;
+import org.teiid.client.util.ExceptionUtil;
 import org.teiid.common.buffer.*;
 import org.teiid.common.buffer.AutoCleanupUtil.Removable;
 import org.teiid.common.buffer.LobManager.ReferenceMode;
@@ -205,7 +206,7 @@
 			CacheKey key = new CacheKey(oid, (int)readAttempts.get(), old!=null?old.getKey().getOrderingValue():0);
 			CacheEntry ce = new CacheEntry(key, sizeEstimate, batch, this.ref, false);
 			if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.TRACE)) {
-				LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Add batch to BufferManager", ce.getId(), "with size estimate", ce.getSizeEstimate()); //$NON-NLS-1$ //$NON-NLS-2$
+				LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Add batch to BufferManager", this.id, ce.getId(), "with size estimate", ce.getSizeEstimate()); //$NON-NLS-1$ //$NON-NLS-2$
 			}
 			maxReserveBytes.addAndGet(-BATCH_OVERHEAD);
 			reserveBatchBytes.addAndGet(-BATCH_OVERHEAD);
@@ -236,7 +237,6 @@
 		@Override
 		public void serialize(List<? extends List<?>> obj,
 				ObjectOutput oos) throws IOException {
-			int expectedModCount = 0;
 			ResizingArrayList<?> list = null;
 			if (obj instanceof ResizingArrayList<?>) {
 				list = (ResizingArrayList<?>)obj;
@@ -245,11 +245,15 @@
 				//it's expected that the containing structure has updated the lob manager
 				BatchSerializer.writeBatch(oos, types, obj);
 			} catch (RuntimeException e) {
+				if (ExceptionUtil.getExceptionOfType(e, ClassCastException.class) != null) {
+					throw e;
+				}
 				//there is a chance of a concurrent persist while modifying 
 				//in which case we want to swallow this exception
-				if (list == null || list.getModCount() == expectedModCount) {
+				if (list == null) {
 					throw e;
 				}
+				LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, e, "Possible Concurrent Modification", id); //$NON-NLS-1$
 			}
 		}
 		
@@ -756,7 +760,7 @@
 		if (persist) {
 			long count = writeCount.incrementAndGet();
 			if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {
-				LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, ce.getId(), "writing batch to storage, total writes: ", count); //$NON-NLS-1$
+				LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, s.getId(), ce.getId(), "writing batch to storage, total writes: ", count); //$NON-NLS-1$
 			}
 		}
 		boolean result = cache.add(ce, s);
@@ -837,7 +841,7 @@
 	
 	CacheEntry remove(Long gid, Long batch, boolean prefersMemory) {
 		if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.TRACE)) {
-			LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Removing batch from BufferManager", batch); //$NON-NLS-1$
+			LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Removing batch from BufferManager", gid, batch); //$NON-NLS-1$
 		}
 		cleanSoftReferences();
 		CacheEntry ce = fastGet(batch, prefersMemory, false);

Modified: branches/7.7.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.7.x/engine/src/main/resources/org/teiid/query/i18n.properties	2014-04-16 15:26:45 UTC (rev 4630)
+++ branches/7.7.x/engine/src/main/resources/org/teiid/query/i18n.properties	2014-04-16 18:26:12 UTC (rev 4631)
@@ -804,7 +804,7 @@
 ProcedurePlan.nonNullableParam=The procedure parameter {0} is not nullable, but is set to null.
  
 FileStoreageManager.error_creating=Error creating {0}
-FileStoreageManager.error_reading=Error reading {0}
+FileStoreageManager.error_reading=Error reading {0} {1}
 FileStoreageManager.no_directory=No directory specified for the file storage manager.
 FileStoreageManager.not_a_directory={0} is not a valid storage manager directory.
 FileStoreageManager.space_exhausted=Max buffer space of {2} bytes has been exceed with an allocation of {0} bytes for a total of {1}.  The current operation will be aborted.



More information about the teiid-commits mailing list