Repository: mars-project/mars

Issue:
[BUG] Storage delete mapper data failed
<!--
Thank you for your contribution!

Please review https://github.com/mars-project/mars/blob/master/CONTRIBUTING.rst before opening an issue.
-->

**Describe the bug**

Storage delete mapper data failed

**To Reproduce**
To help us reproducing this bug, please provide information below:
1. Your Python version
2. The version of Mars you use
3. Versions of crucial packages, such as numpy, scipy and pandas
4. Full stack of the error.
5. Minimized code to reproduce the error.

```
2022-05-10 11:29:14,816 mars.services.scheduling.worker.execution 61 ERROR    Failed to run subtask VtoCZhK76VmqNmR7LMEgDUGw on band numa-0
Traceback (most recent call last):
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/services/scheduling/worker/execution.py", line 386, in internal_run_subtask
    await storage_api.delete.batch(
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/batch.py", line 150, in _async_batch
    return [await self._async_call(*d.args, **d.kwargs)]
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/batch.py", line 95, in _async_call
    return await self.func(*args, **kwargs)
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/services/storage/api/oscar.py", line 150, in delete
    await self._storage_handler_ref.delete(self._session_id, data_key, error=error)
  File "mars/oscar/core.pyx", line 247, in __pyx_actor_method_wrapper
  File "mars/oscar/core.pyx", line 250, in mars.oscar.core.__pyx_actor_method_wrapper
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/batch.py", line 95, in _async_call
    return await self.func(*args, **kwargs)
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/services/storage/handler.py", line 254, in delete
    all_infos = await self._data_manager_ref.get_data_infos(
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/backends/context.py", line 196, in send
    return self._process_result_message(result)
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/backends/context.py", line 76, in _process_result_message
    raise message.as_instanceof_cause()
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/backends/pool.py", line 584, in send
    result = await self._run_coro(message.message_id, coro)
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/backends/pool.py", line 341, in _run_coro
    return await coro
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/api.py", line 120, in __on_receive__
    return await super().__on_receive__(message)
  File "mars/oscar/core.pyx", line 507, in __on_receive__
  File "mars/oscar/core.pyx", line 478, in mars.oscar.core._BaseActor.__on_receive__
  File "mars/oscar/core.pyx", line 479, in mars.oscar.core._BaseActor.__on_receive__
  File "mars/oscar/core.pyx", line 482, in mars.oscar.core._BaseActor.__on_receive__
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/batch.py", line 90, in __call__
    return self._sync_call(*args, **kwargs)
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/oscar/batch.py", line 107, in _sync_call
    return self.func(*args, **kwargs)
  File "/home/admin/work/_cupid_test_release-pymars-0.9.0rc2-js.zip/mars/services/storage/core.py", line 217, in get_data_infos
    if (session_id, data_key) in self._main_key_to_sub_keys:
TypeError: [address=111, pid=61] unhashable type: 'list'
```


Discussion:

Resolving patch:
diff --git a/mars/services/lifecycle/supervisor/tracker.py b/mars/services/lifecycle/supervisor/tracker.py
--- a/mars/services/lifecycle/supervisor/tracker.py
+++ b/mars/services/lifecycle/supervisor/tracker.py
@@ -86,10 +86,6 @@ def _incref_chunks(self, chunk_keys: List[str], counts: List[int] = None):
             self._chunk_ref_counts[chunk_key] += count
 
     async def incref_chunks(self, chunk_keys: List[str], counts: List[int] = None):
-        logger.debug(
-            "Increase reference count for chunks %s",
-            {ck: self._chunk_ref_counts[ck] for ck in chunk_keys},
-        )
         self._check_ref_counts(chunk_keys, counts)
         return await asyncio.to_thread(self._incref_chunks, chunk_keys, counts=counts)
 
@@ -108,10 +104,6 @@ def _get_remove_chunk_keys(self, chunk_keys: List[str], counts: List[int] = None
 
     async def decref_chunks(self, chunk_keys: List[str], counts: List[int] = None):
         self._check_ref_counts(chunk_keys, counts)
-        logger.debug(
-            "Decrease reference count for chunks %s",
-            {ck: self._chunk_ref_counts[ck] for ck in chunk_keys},
-        )
         to_remove_chunk_keys = await asyncio.to_thread(
             self._get_remove_chunk_keys, chunk_keys, counts=counts
         )
diff --git a/mars/services/storage/api/oscar.py b/mars/services/storage/api/oscar.py
--- a/mars/services/storage/api/oscar.py
+++ b/mars/services/storage/api/oscar.py
@@ -189,7 +189,7 @@ async def fetch(
             self._session_id, [data_key], level, band_name, remote_address, error
         )
         if fetch_key:
-            return fetch_key
+            return fetch_key[0]
 
     @fetch.batch
     async def batch_fetch(self, args_list, kwargs_list):


Test patch: