aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2016-03-08 10:40:27 -0800
committerJosh Rosen <joshrosen@databricks.com>2016-03-08 10:40:27 -0800
commitad3c9a9730535faa6d270ee83412f79ec3db8333 (patch)
tree529e1b79fad5e263068528ae67b22443e69f2bc8 /sql/catalyst
parent78d3b6051eea1b5fa9b1a4caa186214b8cca17bf (diff)
downloadspark-ad3c9a9730535faa6d270ee83412f79ec3db8333.tar.gz
spark-ad3c9a9730535faa6d270ee83412f79ec3db8333.tar.bz2
spark-ad3c9a9730535faa6d270ee83412f79ec3db8333.zip
[SPARK-13695] Don't cache MEMORY_AND_DISK blocks as bytes in memory after spills
When a cached block is spilled to disk and read back in serialized form (i.e. as bytes), the current BlockManager implementation will attempt to re-insert the serialized block into the MemoryStore even if the block's storage level requests deserialized caching. This behavior adds some complexity to the MemoryStore but I don't think it offers many performance benefits and I'd like to remove it in order to simplify a larger refactoring patch. Therefore, this patch changes the behavior so that disk store reads will only cache bytes in the memory store for blocks with serialized storage levels. There are two places where we request serialized bytes from the BlockStore: 1. getLocalBytes(), which is only called when reading local copies of TorrentBroadcast pieces. Broadcast pieces are always cached using a serialized storage level, so this won't lead to a mismatch in serialization forms if spilled bytes read from disk are cached as bytes in the memory store. 2. the non-shuffle-block branch in getBlockData(), which is only called by the NettyBlockRpcServer when responding to requests to read remote blocks. Caching the serialized bytes in memory will only benefit us if those cached bytes are read before they're evicted and the likelihood of that happening seems low since the frequency of remote reads of non-broadcast cached blocks seems very low. Caching these bytes when they have a low probability of being read is bad if it risks the eviction of blocks which are cached in their expected serialized/deserialized forms, since those blocks seem more likely to be read in local computation. Given the argument above, I think this change is unlikely to cause performance regressions. Author: Josh Rosen <joshrosen@databricks.com> Closes #11533 from JoshRosen/remove-memorystore-level-mismatch.
Diffstat (limited to 'sql/catalyst')
0 files changed, 0 insertions, 0 deletions