Replies: 3 comments
-
I don't think it should be part of the index report. Internally, an index's "freshness" is a function of the set of indexers one is using. I think that's the important invariant, instead of the indexer state. I think reporting the indexer state via an HTTP header makes a lot of sense, there is/was a scheme to try to make it work via As far as the consistency issue goes, I think it's much easier to handle at the HTTP layer at the load balancer. A cut over and cache expiration scheme would paper over a lot of this, I think. |
Beta Was this translation helpful? Give feedback.
-
Just to make sure I understand correctly, is the set of indexers/scanners (including their versions) not represented by the index state? Is there another way you could discover an index reports freshness? How I'm understanding it is that there currently is no way of seeing if an index report is up to date, as the state it was indexed at isn't stored. Whereas if you stored the index state in the index report you could refer to that. |
Beta Was this translation helpful? Give feedback.
-
One slightly worse scenario of the rollout cornercase I can see is if:
|
Beta Was this translation helpful? Give feedback.
-
Problem
Clair purposely does not have a mechanism for re-indexing, we just surface the
index_state
. This means that integrations must have their own re-submission logic by judging theindex_state
. In Quay's case the process looks something like:/index_state
and looks up all manifests that don't have that state/index_state
)This leads to the possibility of a race condition if the
index_state
changes after the initial state request and before the worker finishes. Under this condition, Quay would save the wrong state with the manifest, this is somewhat mitigated against as the next worker run will recognize the manifest as a candidate for re-indexing and save the new state.e.g
/index_state
(a)index_state
(!a)index_state
s (a and b)Possible solution
To avoid the "rollout-cornercase", we could return the
index_state
with the index_report creation, either as a header or as a part of the index_report.Open Questions
Beta Was this translation helpful? Give feedback.
All reactions