bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

Support isolate read write thread pool

Open 315157973 opened this issue 3 years ago • 4 comments

fix #3003

Motivation

Now , when the Ledger is in the Writable state, the read and write of BookkeeperClient share the same orderExecutor. But, we can not guarantee that the data is not read from disk. In order to avoid reading from affecting writing, we need to add a configuration item to allow read and write requests to use different thread pools

Changes

Add a param to support isolate read write thread pool.

315157973 avatar Feb 17 '22 07:02 315157973

rerun failure checks

315157973 avatar Feb 17 '22 09:02 315157973

  1. read request doesn't wait for the completion on that threadpool.

When cold data is read, it will take a long time. At this time, the read request will be blocked, resulting in the write timeout.

Can I see a test reproing this? i suspect the problem is somewhere else.

  1. The ordering there is required for a reason.

The test in this PR simply does not cover anything related to actual functionality. I suggest trying to enable the feature by default and running all tests to see what breaks, it's hard to come up with something more specific off the top of my head.

  1. Do you have apples-to-apples comparison of performance, same load, same bookies etc, the feature off/on?

OK, I will do a performance test and add more monitoring information

315157973 avatar Feb 18 '22 02:02 315157973

btw. It's worth considering thread safety issues and preventing them. In Pulsar, https://github.com/apache/pulsar/issues/14436 seems to be caused by a thread safety issue in Bookkeeper client. It might be caused by #1792 changes which are in the same area as this PR.

lhotari avatar Mar 13 '22 19:03 lhotari

fix old workflow,please see #3455 for detail

StevenLuMT avatar Aug 24 '22 08:08 StevenLuMT

  1. read request doesn't wait for the completion on that threadpool.

When cold data is read, it will take a long time. At this time, the read request will be blocked, resulting in the write timeout.

Can I see a test reproing this? i suspect the problem is somewhere else.

  1. The ordering there is required for a reason.

The test in this PR simply does not cover anything related to actual functionality. I suggest trying to enable the feature by default and running all tests to see what breaks, it's hard to come up with something more specific off the top of my head.

  1. Do you have apples-to-apples comparison of performance, same load, same bookies etc, the feature off/on?

For ledgers in the Writable state, reading and writing share the same thread pool, and there is no way to isolate reading and writing; IMO, it is useful to isolate reads and writes to different threads of execution; @dlg99

lordcheng10 avatar Jan 11 '23 02:01 lordcheng10