kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

feat: support limit WriteBatch size

Open AntiTopQuark opened this issue 1 year ago • 4 comments

relate to https://github.com/apache/kvrocks/issues/2284

Added the ability to limit the size of WriteBatch operations in RocksDB to control memory usage effectively.

AntiTopQuark avatar Aug 28 '24 02:08 AntiTopQuark

@AntiTopQuark Thanks for your efforts. Would you mind adding a Go test case for this?

git-hulk avatar Aug 28 '24 02:08 git-hulk

@AntiTopQuark Thanks for your efforts. Would you mind adding a Go test case for this?

Sure, I will complete this task later.

AntiTopQuark avatar Aug 28 '24 02:08 AntiTopQuark

While adding cases, it was found that there were no corresponding error messages, so error codes were added and reported in many places involving batch processing

AntiTopQuark avatar Aug 28 '24 15:08 AntiTopQuark

While adding cases, it was found that there were no corresponding error messages, so error codes were added and reported in many places involving batch processing

Yes, that makes sense.

git-hulk avatar Aug 29 '24 08:08 git-hulk

@AntiTopQuark One comment inline, rest are good to me. Could anyone also have a look at this PR? @PragmaTwice @torwig @caipengbo @mapleFU

git-hulk avatar Aug 30 '24 02:08 git-hulk

Also cc @PragmaTwice

Do we need some macro like RETURN_NOT_OK, RETURN_NOT_OK_FROM_ROCKSDB?

@mapleFU @AntiTopQuark RETURN_IF_ERR is also good for this?

git-hulk avatar Sep 04 '24 02:09 git-hulk

I think it's good. Another problem is that we may need type cast between Status and rocksdb::Status. We can make a new issue here.

mapleFU avatar Sep 04 '24 02:09 mapleFU

Yes, let's discuss this in new issue.

git-hulk avatar Sep 04 '24 02:09 git-hulk

Also cc @PragmaTwice

Do we need some macro like RETURN_NOT_OK, RETURN_NOT_OK_FROM_ROCKSDB?

Nope. They can be done by GET_OR_RET.

PragmaTwice avatar Sep 04 '24 03:09 PragmaTwice

Nope. They can be done by GET_OR_RET.

So GET_OR_RET can also handle the case for pure "Status"?

Besides, what about err from rocksdb?

mapleFU avatar Sep 04 '24 03:09 mapleFU