Skip to content
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

ConsistencyDelayMetaFilter should filter on the block upload time and not the block creation time #2585

Closed
pracucci opened this issue May 11, 2020 · 22 comments

Comments

@pracucci
Copy link
Contributor

pracucci commented May 11, 2020

The ConsistencyDelayMetaFilter filter currently filters out blocks based on the ULID time, which is the time when the block has been created:

if ulid.Now()-id.Time() < uint64(f.consistencyDelay/time.Millisecond) &&

This means that if that actual consistency delay is the configured delay minus the upload time. If the delay is X but the block upload time is > X, the consistency delay is effectively ignored.

To correct approach would be checking the consistency delay against the "block upload completed timestamp" and, to do so, checking the meta.json creation time could be fine. However, object stores stores the "updated time" and not the "creation time", so I'm wondering how safe would be using it. Thoughts?

@bwplotka
Copy link
Member

There was already issue for that...

@bwplotka
Copy link
Member

I can't find this ticket ;p So let's keep this.

Definitely todo. We did not have just yet modified Time API in objstore that's the reason why. Modified will be just enough I think, even though creation would be better here. The difficulty it so add working implementation of mod time to all implementations now.

We started some work in some old PRs. I think we also thought getting the Size, ModTime in one method Attr which is common pattern.

@pracucci
Copy link
Contributor Author

We started some work in some old PRs. I think we also thought getting the Size, ModTime in one method Attr which is common pattern.

The problem of doing it is that we'll double the API calls for this specific use case, because most of the object stores allow to get it along with the GET object API call (as response HTTP headers).

How would you feel about changing the BucketReader.Get() signature from:
Get(ctx context.Context, name string) (io.ReadCloser, error)

To:
Get(ctx context.Context, name string) (io.ReadCloser, *ObjectInfo, error)

Where ObjectInfo is:

type ObjectInfo struct {
    Size uint64
    LastModified time.Time
}

With the contract that if such information are unavailable return returned ObjectInfo is nil (basically a best effort).

@pracucci
Copy link
Contributor Author

pracucci commented May 14, 2020

On the other side, adding a ObjectInfo() function would reduce the surface change and it's also true that could be a piece of information that could be cached by #2579.

@pstibrany
Copy link
Contributor

It seems weird for it to be part of Get, even when we try to optimize for number of requests (which is not a problem for all object stores). There may be legitimate use-cases to need that data without needing content of object. I think dedicated method would be better way to design this.

@pracucci
Copy link
Contributor Author

After a brief discussion on Slack, looks there's consensus for adding the Attributes(ctx, name) (ObjectInfo, error) function to BucketReader, including Size and LastModified for now.

@stale
Copy link

stale bot commented Jun 13, 2020

Hello 👋 Looks like there was no activity on this issue for last 30 days.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity for next week, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@bwplotka
Copy link
Member

Still valid and actually possible thanks to recent changes. Some description why it's important you can see here: #2470

@stale stale bot removed the stale label Jun 15, 2020
@bwplotka
Copy link
Member

Question from my side: Should we cache in anyway the ModTime. I think yes.

@pstibrany
Copy link
Contributor

Question from my side: Should we cache in anyway the ModTime. I think yes.

We already cache modification time, if that’s what you’re saying.

@bwplotka
Copy link
Member

😱 That's perfect yes (if someone uses cache option for this).

Then it's quite easy work, marking as good first issue

@stale
Copy link

stale bot commented Jul 15, 2020

Hello 👋 Looks like there was no activity on this issue for last 30 days.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity for next week, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Jul 15, 2020
@yeya24
Copy link
Contributor

yeya24 commented Jul 15, 2020

Valid. #2883 is open.

@stale stale bot removed the stale label Jul 15, 2020
@stale
Copy link

stale bot commented Aug 15, 2020

Hello 👋 Looks like there was no activity on this issue for last 30 days.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity for next week, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Aug 15, 2020
@pracucci
Copy link
Contributor Author

Valid. #2883 is open.

@stale stale bot removed the stale label Aug 17, 2020
@stale
Copy link

stale bot commented Oct 16, 2020

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Oct 16, 2020
@bwplotka
Copy link
Member

bwplotka commented Oct 16, 2020 via email

@stale stale bot removed the stale label Oct 16, 2020
@stale
Copy link

stale bot commented Dec 15, 2020

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Dec 15, 2020
@yeya24
Copy link
Contributor

yeya24 commented Dec 16, 2020

Not stale.

@stale stale bot removed the stale label Dec 16, 2020
@stale
Copy link

stale bot commented Feb 14, 2021

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Feb 14, 2021
@GiedriusS GiedriusS removed the stale label Mar 4, 2021
@stale
Copy link

stale bot commented Jun 2, 2021

Hello 👋 Looks like there was no activity on this issue for the last two months.
Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗
If there will be no activity in the next two weeks, this issue will be closed (we can always reopen an issue if we need!). Alternatively, use remind command if you wish to be reminded at some point in future.

@stale stale bot added the stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jun 16, 2021

Closing for now as promised, let us know if you need this to be reopened! 🤗

@stale stale bot closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants