Skip to content
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

[SPARK-3941][CORE] _remainingmem should not increase twice when updateBlockInfo #2792

Closed

Conversation

liyezhang556520
Copy link
Contributor

In BlockManagermasterActor, _remainingMem would increase memSize for twice when updateBlockInfo if new storageLevel is invalid and old storageLevel is "useMemory". Also, _remainingMem should increase with original memory size instead of new memSize.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/21717/
Test FAILed.

@liyezhang556520
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Oct 14, 2014

QA tests have started for PR 2792 at commit 0380a32.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Oct 14, 2014

QA tests have finished for PR 2792 at commit 0380a32.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/21721/
Test PASSed.

// The block exists on the slave already.
val blockStatus: BlockStatus = _blocks.get(blockId)
val originalLevel: StorageLevel = blockStatus.storageLevel
val originalMemSize: Long = blockStatus.memSize
Copy link
Contributor

Choose a reason for hiding this comment

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

The old code seems a little more concise

@andrewor14
Copy link
Contributor

Hey @liyezhang556520 I believe your fix is correct. However, if we put it in the isValid case it seems that it's now duplicated in two places. Would it make sense to keep the code you deleted and remove it in the case where it's inValid?

@liyezhang556520
Copy link
Contributor Author

Good idea, I'll update it soon.

@liyezhang556520
Copy link
Contributor Author

@andrewor14 , code updated, would you please have a look?

@SparkQA
Copy link

SparkQA commented Oct 17, 2014

QA tests have started for PR 2792 at commit 3d487cc.

  • This patch merges cleanly.


if (originalLevel.useMemory) {
_remainingMem += memSize
_remainingMem += originalMemSize
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a change in semantics. Can you explain why the old code is incorrect (is it)? I'm just trying to understand what this block is trying to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"memSize" is the current memory that the block consume, "originalMemSize" is the memory used before block updating. These two size might be not the same. So here, if the block exists on the slave already, _remainingmem should first _remainingMem += originalMemSize and then _remainingMem -= memSize if the new storage level is "useMemory". Do I have misunderstanding of these two mem size?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, we want to release the originalMemSize and occupy the new memSize. That makes sense. It seems that the old code is just wrong in some cases then.

@andrewor14
Copy link
Contributor

LGTM. I'm merging this.

@asfgit asfgit closed this in 642b246 Oct 17, 2014
@SparkQA
Copy link

SparkQA commented Oct 17, 2014

QA tests have finished for PR 2792 at commit 3d487cc.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/21829/
Test PASSed.

@liyezhang556520 liyezhang556520 deleted the spark-3941-remainMem branch October 29, 2014 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants