Closed jixuan1989 closed 5 years ago
@liuruiyiyang can you try to reproduce the scenario? @liukun4515 can you confirm it logically? By the way, when a user write data, and at the same time, a flushing operation occurs, what will happen?
A thread can call the interface of memtable, it should acquire the lock in the corresponding filenode first. @jixuan1989
By the way, when a user write data, and at the same time, a flushing operation occurs, what will happen?
The data is written into the memtable, which will be flushed in a background thread. At the same time, we will give a new memtable which is used to store newly written data.
By the way, when a user write data, and at the same time, a flushing operation occurs, what will happen?
The data is written into the memtable, which will be flushed in a background thread. At the same time, we will give a new memtable which is used to store newly written data.
By the way, when a user write data, and at the same time, a flushing operation occurs, what will happen?
The data is written into the memtable, which will be flushed in a background thread. At the same time, we will give a new memtable which is used to store newly written data.
So this problem doesn't exist, right ?
But I think it is a coarse-grained implementation. It limits the concurrency. Anyway, current implementation is correct.
By the way, when a user write data, and at the same time, a flushing operation occurs, what will happen?
The data is written into the memtable, which will be flushed in a background thread. At the same time, we will give a new memtable which is used to store newly written data.
By the way, when a user write data, and at the same time, a flushing operation occurs, what will happen?
The data is written into the memtable, which will be flushed in a background thread. At the same time, we will give a new memtable which is used to store newly written data.
So this problem doesn't exist, right ?
yes @xingtanzjr
But I think it is a coarse-grained implementation. It limits the concurrency. Anyway, current implementation is correct.
The method of concurrent control must limit the concurrency, but we should do something else synchronously for each filenode processor before data to be written into the memtable. @jixuan1989
I noticed that we do not obtain any lock when write data in memtable.
Suppose two client send data to IoTDB, one writes
d1.s1
and meanwhile the other writesd1.s2
. If both of them runmemTableMap.put(deltaObject, new HashMap<>());
, then we will lost some data.see
AbstractMemTable.java
: