-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB(with RocksDB engine) RangeDeleter is too slow. #142
Comments
I have found the reason why RangeDeleter of MongoDB(with RocksDB) is so slow. MongoDB use "indexScan" instance for RangeDeleter(of MongoDB not RocksDB) processing. But in this code(https://github.com/mongodb/mongo/blob/r3.4.14/src/mongo/db/dbhelpers.cpp#L366), worse thing is the first exec->getNext() call is really slow with RocksDB storage engine. Not for Wiredtiger storage engine.
Because of current implementation of RangeDeleter, getNext() func is called only once for each indexScan object. Meaning RangeDeleter use very frist(very slow) exec->getNext(). Why first call of indexScan->getNext() is so slow with RocksDB ? Regards, |
This is happen the last release version of MongoDB and MongoRocks (and RocksDB) MongoDB 3.4.14, RocksDB 5.12.2 |
Good find. The problem here is that |
Hi Igor. I think tombstone is spreaded everywhere in the index. So I have expected every getNext() takes same time. I am curios that why first getNext() call only slow, following getNext() call is not. We can avoid this RangeDeleter issue with simple modifying MongoDB RangeDeleter code. Regards, |
That might be true at the beginning of the operation, but as soon as RangeDeleter kicks in it starts adding new tombstones at the beginning of the range, right?
That's good to hear. |
I I ran into the same problem using version 3.4.18. 2021-03-03T07:53:04.558+0800 I SHARDING [RangeDeleter] Deleter starting delete for: rs40.rs2 from { _id: 6862256481019475218 } -> { _id: 6862276335282767516 }, with opId: 2168351339 |
@q96456 |
@eharry { |
@q96456 |
@sunlike-Lipo |
After chunk migration,
MongoDB call RangeDeleter(Not RocksDB, it's mongodb background thread name) to remove obsolete documents moved to another shards.
With MongoRocks, RangeDeleter is too slow. Sometimes it takes over 2 hours to remove only 1 chunk's documents. About 20000 ~ 80000 documents in a chunk. Some shards, RangeDeleter of 1 chunk takes 7~8 hour.
So now, chunk balancing is blocked because stacked task in RangeDeleter queue is full.
And I also cleanup these obsolete documents(after moved to another shard) with "cleanupOrphaned" command. It also takes a lot of time.
There's only 189984 documents in this collection. And removed only 38328 documents with "cleanupOrphaned" command, But it took 14 minutes.
What is wrong with my MongoRocks setup ?
The text was updated successfully, but these errors were encountered: