Read objects from registry #86

Merged
fyrchik merged 1 commit from dstepanov-yadro/xk6-frostfs:feat/use_registry_for_read into master 2023-07-26 21:08:04 +00:00

If registry_file is specified, then reading will be performed from it. The objects will be read in a circle.

Closes #25

If `registry_file` is specified, then reading will be performed from it. The objects will be read in a circle. Closes #25
dstepanov-yadro force-pushed feat/use_registry_for_read from c854f52f5b to 0cffff1fa6 2023-07-19 14:25:20 +00:00 Compare
dstepanov-yadro reviewed 2023-07-19 14:27:33 +00:00
@ -93,3 +93,3 @@
}
func (o *ObjSelector) selectLoop() {
func (o *ObjSelector) selectLoop(maxDuration time.Duration) {
Author
Member

If registry file is empty, NextObject() will be blocked forever. teardown waits workers to finish.

If registry file is empty, `NextObject()` will be blocked forever. `teardown` waits workers to finish.
Owner

NextObject() will be blocked forever

Isn't it a bug? It seems we close(o.objChan) in the selectLoop() and exit from it via the context.

>NextObject() will be blocked forever Isn't it a bug? It seems we `close(o.objChan)` in the `selectLoop()` and exit from it via the context.
Author
Member

According NextObject comment, it is expected behaviour.

According NextObject comment, it is expected behaviour.
Author
Member

Replaced with timeout in NextObject method.

Replaced with timeout in NextObject method.
Owner

To me the problem is here:

underlying registry context is done

This should happen if we don't have any objects, right?

To me the problem is here: >underlying registry context is done This should happen if we don't have any objects, right?
dstepanov-yadro reviewed 2023-07-19 14:28:20 +00:00
@ -164,3 +169,3 @@
// no more objects, wait a little; the logic could be improved.
select {
case <-time.After(time.Second * time.Duration(o.filter.Age/2)):
case <-time.After(time.Second):
Author
Member

For READ scenario there is no age, so just wait for 1 second.

For READ scenario there is no age, so just wait for 1 second.
dstepanov-yadro requested review from storage-core-committers 2023-07-19 14:30:47 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-07-19 14:30:48 +00:00
dstepanov-yadro force-pushed feat/use_registry_for_read from 0cffff1fa6 to cdbfa1a40e 2023-07-19 15:16:44 +00:00 Compare
aarifullin reviewed 2023-07-19 20:28:35 +00:00
@ -46,3 +46,3 @@
var comma string
for i := 0; i < count; i++ {
info := o.selector.NextObject()
info := o.selector.NextObject(5)
Member

Why is it 5? :) How did you adjust this parameter?

Why is it `5`? :) How did you adjust this parameter?
Author
Member

Expert evaluation method

Expert evaluation method
aarifullin approved these changes 2023-07-19 20:28:40 +00:00
dkirillov reviewed 2023-07-20 06:26:11 +00:00
@ -152,0 +166,4 @@
if (!obj) {
return;
}
const resp = grpc_client.get(obj.c_id, obj.o_id)
Member

Can we add the same for s3 scenarios?

Can we add the same for s3 scenarios?
Author
Member

Done

Done
dstepanov-yadro force-pushed feat/use_registry_for_read from cdbfa1a40e to 0dc0ba1704 2023-07-20 08:43:58 +00:00 Compare
fyrchik reviewed 2023-07-20 11:49:58 +00:00
@ -55,9 +55,45 @@ func NewObjSelector(registry *ObjRegistry, selectionSize int, filter *ObjFilter)
// - underlying registry context is done, nil objects will be returned on the
// currently blocked and every further NextObject calls.
func (o *ObjSelector) NextObject() *ObjectInfo {
if !o.hasAnyObj() {
Owner

Wow, if we call it on each next this should have noticeable impact on the performance (we iterate over the database).

Wow, if we call it on _each_ next this should have noticeable impact on the performance (we iterate over the database).
Author
Member

ok, removed

ok, removed
dstepanov-yadro force-pushed feat/use_registry_for_read from e52ca33fbc to 704c0f06bc 2023-07-20 12:02:25 +00:00 Compare
dkirillov approved these changes 2023-07-20 13:17:17 +00:00
dkirillov left a comment
Member

LGTM, didn't run

LGTM, didn't run
fyrchik approved these changes 2023-07-20 13:38:59 +00:00
fyrchik merged commit 704c0f06bc into master 2023-07-20 13:39:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/xk6-frostfs#86
No description provided.