Open gengliqi opened 3 years ago
@gengliqi can you post write batch size and write duration metrics separately? want to see move details of what affects the write efficiency you defined.
@gengliqi can you post write batch size and write duration metrics separately? want to see move details of what affects the write efficiency you defined.
OK.
@gengliqi thanks.
It may be easier to read if metrics are average on a wider time window, but it looks like the write batch size are similar. My wild guess would be multibatch write taking more time on synchronization, but we may need some profiling to see.
@yiwu-arbug @Connor1996 @Little-Wallace I test the pipelined write. It seems the multibatch write is a little better than pipelined write.
It's as expected. So seems the multi-batch works well, it's mainly due to unordered_write has a better write duration which is as expected too.
From raft perspective, it only needs a consistent rocksdb view when creating snapshot. With #4379, we can ensure the rocksdb snapshot is immutable even under unordered write.
From transaction perspective, as long as there are still two phase commit, prewrite and commit are not in the same write batch, non-atomic write and mutable snapshot should not affect the correctness of transaction snapshot.
From raw KV perspective, it can still bring incorrect result as write batch is not atomic anymore. Though we have not promised write requests are atomic.
At least, it seems safe for TiKV to enable unordered writes if it's for TiDB usages only?
/cc @Little-Wallace @youjiali1995
If we want to move forward with unordered write we need a GA plan.
/type bug
This is not a bug, removing the tag.
How about improving the pipeline write just like unordered-write
? CockroachDB has finished some work on this. See more details in https://github.com/cockroachdb/pebble/blob/master/docs/rocksdb.md#commit-pipeline
I do not think it is a good idea to move forward to unordered-write
. It may cause more problem in the future because we can not make the write batch atomic.
Bug Report
What version of TiKV are you using?
4.0.8
What operating system and CPU are you using?
I think it's doesn't matter.
Steps to reproduce
datacreate.tar.gz I use
init_schema.sql
to create table. Change the IP and port of tidb intidb.sh
and run it.Then I change to use unordered write.
The definition of write efficiency is
write batch size / write duration
.I find the multibatch's write efficiency is much worse than unordered write in kv db.