Map with Near Cache causes get_all operations to fail with exception.

Đang mở
#701 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
distributed-systems

Hướng nghiên cứu

Bắt đầu bằng cách chạy bản tái hiện Python được cung cấp với Hazelcast Python Client, cả khi có và không có Near Cache, tập trung vào get_all(keys) và ngoại lệ chuyển đổi dictionary được báo cáo. Truy vết đường đi Near Cache được get_all sử dụng và so sánh nó với thao tác map không được cache. Hoàn thành nghĩa là get_all chạy thành công cho map Near Cache mà không có ngoại lệ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Source: Community

This code will replicate the issue.
Running the Hazelcast Python Client 5.5.0 driver, with a 3 node cluster running community 5.5.
Downgrading did not fix the issue.
Exception was cannot convert dictionary update sequence element #0 to a sequence

import time
import uuid

import hazelcast
from hazelcast.config import NearCacheConfig, InMemoryFormat

test_size = 10000

test_target_near_cache_config = NearCacheConfig()
test_target_near_cache_config.in_memory_format = InMemoryFormat.BINARY
test_target_near_cache_config.time_to_live = 30
test_target_near_cache_config.max_idle = 15
test_target_near_cache_config.eviction_max_size = test_size * 2

client = hazelcast.HazelcastClient(
    cluster_name="hazelcast",
    cluster_members=[...
    ],
    near_caches={
       "test-target-nc": test_target_near_cache_config
    }
)

nc_map = client.get_map('test-target-nc')
uc_map = client.get_map('test-target-uc')

def readSingle(map, keys):
    try:
        startms = round(time.time() * 1000)
        futures = []
        for key in keys:
            futures.append(map.get(key))
        for future in futures:
            future.result()
        endms = round(time.time()* 1000)
        print(f"total time: {endms - startms:0.2f}ms")
        print(f"op    time: {(endms - startms)/(len(keys)):0.2f}ms")
    except Exception as e:
        print("operation failed", e)

def readMulti(map, keys):
    try:
        startms = round(time.time() * 1000)
        map.get_all(keys).result()
        endms = round(time.time()* 1000)
        print(f"total time: {endms - startms:0.2f}ms")
        print(f"op    time: {(endms - startms)/(len(keys)):0.2f}ms")
    except Exception as e:
        print("operation failed", e)



content = {}
for index in range(0, test_size):
    id = uuid.uuid4()
    value = uuid.uuid4()
    content[id] = value

keys = list(content.keys())

nc_map.put_all(content)
uc_map.put_all(content)

print("Warm Near Cache")
futures = []
for key in keys:
    futures.append(nc_map.get(key))
for future in futures:
    future.result()

print('Read Single, No Cache')
readSingle(uc_map, keys)
print('Read Single, With Cache')
readSingle(nc_map, keys)
print('Read Multi, No Cache')
readMulti(uc_map, keys)
print('Read Multi, With Cache')
readMulti(nc_map, keys)
Ngôn ngữ chính
Python
Star
115
Fork
78
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hazelcast/hazelcast-python-client

Tất cả issue của hazelcast/hazelcast-python-client

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.