Repository navigation
Conversation
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
f520f3b to
13c788a
Compare
|
jenkins test make check |
13c788a to
401e5de
Compare
401e5de to
5c740ca
Compare
| tokens_waiter tw(this); | ||
| for (const auto& table_name : tables_to_process) { | ||
| // start processing a table | ||
| tokens_waiter::token token(&tw); |
There was a problem hiding this comment.
the token flow looks wrong.
the token is defined outside the lambda, thus it immediately decrease the counter(pending token) after the spawn.
the pending token gets zero(by token destructor), the waiter signal for complete, while task is on work.
pending token does not reflect the amount of task-on-work
There was a problem hiding this comment.
you are right. i should move the token into the lambda as in here: https://github.com/ceph/ceph/blob/main/src/rgw/driver/rados/rgw_notify.cc#L500
it should be created before the lambda, so that we are guaranteed to wait on it even if no coroutine was scheduled.
| boost::asio::executor_work_guard<Executor> work_guard; | ||
| std::vector<std::thread> workers; | ||
| rgw::sal::Driver* const driver; | ||
| std::unordered_map<table_name_t, ceph::coarse_real_time, boost::hash<table_name_t>> tables; |
There was a problem hiding this comment.
note: the variable tables (map) keeps growing, slowly. entries are not deleted.
There was a problem hiding this comment.
right. i would need to have "table deletion" notes to the queue
| // TODO: check if processing is needed based on unindexed rows stats and skip if not needed | ||
| // TODO: check if processign already started for the table and skip if yes | ||
| // TODO: implement actual lancedb table processing logic here | ||
| // for PoC just sleep for some time to simulate processing |
There was a problem hiding this comment.
a note : upon this function is called per table-modification ( put / delete ),
it needs to check the index-state (number of un-indexed-rows) , that is a lance-db call to fetch table meta-data.
in case it met the threshold it need to rebuild the index.
the workload to consider is a burst of vectors (concurrent requests),
it need to limit the calls to get-table-metadata (window time limitation).
| const auto now = ceph::coarse_real_clock::now(); | ||
| const auto time_since_last_process = now - it->second; | ||
| if (time_since_last_process > std::chrono::milliseconds(5000)) { | ||
| ldpp_dout(this, 20) << "INFO: will try to process table: " << table_name.first << "." << table_name.second << |
There was a problem hiding this comment.
note: pushing a task (for the same table) only if enough time had passed.
workload : burst of table-modifications(put/delete) requests.
There was a problem hiding this comment.
the burst is mitigated in 2 ways:
- the queue may have multiple entries for the same table. but since "tables" is a set, it will be inserted only once per queue processing
- we check the time difference since lance processing
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
backround process commits merged into: #66066 |
There was a problem hiding this comment.
the graceful shutdown not clear whether it works correctly.
the std::async launch a thread that is blocked until the worker is joined.
if the worker had joined(in less than 1 sec), that's ok, moving to the next worker.
if not , future is waiting for 1sec -> io_context.stop() -> worker.join (line 207) and another worker.join (line 200)
it may cause a double worker.join
There was a problem hiding this comment.
@yuvalif
the consume_all pop the messages, create unique_ptr on the poped-message (thus it deleted).
upon shutdown, the consume_all is skipped, thus .. the messages in queue are never deleted (notify-index -> shutdown).
destructor should drain the queue.
There was a problem hiding this comment.
addressed in above PR
No description provided.