tikv / raft-engine

A persistent storage engine for Multi-Raft log
Apache License 2.0
565 stars 88 forks source link

clean regions from rewrite queue #54

Closed hicqu closed 4 years ago

hicqu commented 4 years ago

Signed-off-by: qupeng qupeng@pingcap.com

It's possible for a region:

  1. rewrite some entries and kvs into the rewrite queue
  2. then the region has been removed from the engine
  3. The log contains the Command::Clean for the region has been purged.
  4. The regine restarts, the removed region appears again because there are some entires in the rewrite queue.

This PR resolves it. The Command::Clean will be written into the rewrite queue before the append queue has been purged.