OpenAtomFoundation / pikiwidb

a high-performance, large-capacity, multi-tenant, data-persistent, strong data consistency based on raft, Redis-compatible elastic KV data storage system based on RocksDB
BSD 3-Clause "New" or "Revised" License
202 stars 63 forks source link

fix:multiple threads write data, pointer error #161

Closed lqxhub closed 9 months ago

lqxhub commented 9 months ago

修复多线程下,网络写入指针错误.

libevent 中 多线程写入需要异步写入, 但是之前的 data 指针 因为异步的原因, 会导致原来的数据先被释放了,所以写入的数据会出错. 现在在写入前, 先复制了一份,保证不会出错