Skip to content

[SPARK-17113][Shuffle] Job failure due to Executor OOM in offheap mode #14693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public long spill() throws IOException {
// is accessing the current record. We free this page in that caller's next loadNext()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rxin - We already have comment describing the spilling strategy here. Do you think we need more details?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - this is good.

// call.
for (MemoryBlock page : allocatedPages) {
if (!loaded || page.getBaseObject() != upstream.getBaseObject()) {
if (!loaded || page.pageNumber != ((UnsafeInMemorySorter.SortedIterator)upstream).getCurrentPageNumber()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you not just reference inMemIterator here? no cast needed/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, changed accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use inMemIterator here, it's different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes you're right. It's a clone and they will have a different page number.

released += page.size();
freePage(page);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public final class SortedIterator extends UnsafeSorterIterator implements Clonea
private long baseOffset;
private long keyPrefix;
private int recordLength;
private long currentPageNumber;

private SortedIterator(int numRecords, int offset) {
this.numRecords = numRecords;
Expand All @@ -262,6 +263,7 @@ public SortedIterator clone() {
iter.baseOffset = baseOffset;
iter.keyPrefix = keyPrefix;
iter.recordLength = recordLength;
iter.currentPageNumber = currentPageNumber;
return iter;
}

Expand All @@ -279,6 +281,7 @@ public boolean hasNext() {
public void loadNext() {
// This pointer points to a 4-byte record length, followed by the record's bytes
final long recordPointer = array.get(offset + position);
currentPageNumber = memoryManager.decodePageNumber(recordPointer);
baseObject = memoryManager.getPage(recordPointer);
baseOffset = memoryManager.getOffsetInPage(recordPointer) + 4; // Skip over record length
recordLength = Platform.getInt(baseObject, baseOffset - 4);
Expand All @@ -292,6 +295,10 @@ public void loadNext() {
@Override
public long getBaseOffset() { return baseOffset; }

public long getCurrentPageNumber() {
return currentPageNumber;
}

@Override
public int getRecordLength() { return recordLength; }

Expand Down