[core] Add flag to enable object reconstruction during ray start (#9488)

* Add flag

* doc

* Fix tests
This commit is contained in:
Stephanie Wang
2020-07-17 10:13:14 -07:00
committed by GitHub
parent f080aa6ce3
commit b351d13940
6 changed files with 119 additions and 35 deletions
+16
View File
@@ -92,6 +92,8 @@ class RayParams:
_internal_config (str): JSON configuration for overriding
RayConfig defaults. For testing purposes ONLY.
lru_evict (bool): Enable LRU eviction if space is needed.
enable_object_reconstruction (bool): Enable plasma reconstruction on
failure.
"""
def __init__(self,
@@ -135,6 +137,7 @@ class RayParams:
java_worker_options=None,
load_code_from_local=False,
_internal_config=None,
enable_object_reconstruction=False,
metrics_agent_port=None,
lru_evict=False):
self.object_ref_seed = object_ref_seed
@@ -177,6 +180,7 @@ class RayParams:
self.metrics_agent_port = metrics_agent_port
self._internal_config = _internal_config
self._lru_evict = lru_evict
self._enable_object_reconstruction = enable_object_reconstruction
self._check_usage()
# Set the internal config options for LRU eviction.
@@ -191,6 +195,18 @@ class RayParams:
self._internal_config["object_store_full_max_retries"] = -1
self._internal_config["free_objects_period_milliseconds"] = 1000
# Set the internal config options for object reconstruction.
if enable_object_reconstruction:
# Turn off object pinning.
if self._internal_config is None:
self._internal_config = dict()
if lru_evict:
raise Exception(
"Object reconstruction cannot be enabled if using LRU "
"eviction.")
self._internal_config["lineage_pinning_enabled"] = True
self._internal_config["free_objects_period_milliseconds"] = -1
def update(self, **kwargs):
"""Update the settings according to the keyword arguments.