This is an automated email from the ASF dual-hosted git repository.

wyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new aa3167d2ea [ASTERIXDB-3463] Revert ASTERIXDB-3360
aa3167d2ea is described below

commit aa3167d2ea534b55ab9226da25a7be7d8d82fd81
Author: Wail Alkowaileet <[email protected]>
AuthorDate: Wed Jul 17 09:29:43 2024 -0700

    [ASTERIXDB-3463] Revert ASTERIXDB-3360
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    Revert ASTERIXDB-3360 as it has caused several
    issues. This can be revesited in the future and
    can be eneabled again.
    
    Ext-ref: MB-62736
    Change-Id: I24b4e7bcd5790b04d0db7b3c2796ca09f0206040
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18493
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Wail Alkowaileet <[email protected]>
    Reviewed-by: Murtadha Hubail <[email protected]>
---
 .../bytes/stream/out/MultiPersistentBufferBytesOutputStream.java  | 6 ------
 .../apache/asterix/column/values/writer/ColumnBatchWriter.java    | 5 +----
 .../hyracks/storage/common/file/CompressedBufferedFileHandle.java | 8 +-------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git 
a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
 
b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
index 90aacc7fbf..c910131a6c 100644
--- 
a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
+++ 
b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
@@ -38,12 +38,6 @@ public final class MultiPersistentBufferBytesOutputStream 
extends AbstractMultiB
     @Override
     protected void preReset() throws HyracksDataException {
         if (allocatedBytes > 0) {
-            /*
-             * Ensure limit is set to current position and position is set to 
0. This to ensure no unrelated bytes are
-             * persisted to disk. Unrelated bytes are bytes that were in the 
ByteBuffer (when the column writer
-             * confiscated it from the buffer cache) but those byte do not 
belong to the column that to be written.
-             */
-            currentBuf.flip();
             //Persist all buffers before resetting the stream
             multiPageOpRef.getValue().persist();
             allocatedBytes = 0;
diff --git 
a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
 
b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
index 1d8f6847a4..ee121407bb 100644
--- 
a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
+++ 
b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
@@ -94,10 +94,7 @@ public final class ColumnBatchWriter implements 
IColumnBatchWriter {
         }
 
         // compute the final length
-        int totalLength = nonKeyColumnStartOffset + columns.size();
-        // reset to ensure the last buffer's position and limit are set 
appropriately
-        columns.reset();
-        return totalLength;
+        return nonKeyColumnStartOffset + columns.size();
     }
 
     @Override
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
index 6bc85ffeb4..86511d1067 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
@@ -111,11 +111,7 @@ public class CompressedBufferedFileHandle extends 
BufferedFileHandle {
             final long bytesWritten;
             final long expectedBytesWritten;
 
-            if (cPage.isLargePage()) {
-                fixBufferPointers(uBuffer, 0);
-            } else {
-                uBuffer.position(0);
-            }
+            fixBufferPointers(uBuffer, 0);
             long offset;
             if (compressToWriteBuffer(uBuffer, cBuffer) < 
bufferCache.getPageSize()) {
                 cBuffer.position(0);
@@ -125,8 +121,6 @@ public class CompressedBufferedFileHandle extends 
BufferedFileHandle {
             } else {
                 // Compression did not gain any savings
                 final ByteBuffer[] buffers = header.prepareWrite(cPage);
-                // Incompressible pages should be written entirely
-                fixBufferPointers(buffers[1], 0);
                 offset = compressedFileManager.writePageInfo(pageId, 
bufferCache.getPageSizeWithHeader());
                 expectedBytesWritten = buffers[0].limit() + (long) 
buffers[1].limit();
                 bytesWritten = context.write(ioManager, handle, offset, 
buffers);

Reply via email to