Skip to content

MetadataSegmentView should correctly handle the situation of Coordinator being down or changed leadership #7391

@leventov

Description

@leventov

Regardless of whether any of the designs proposed for MetadataSegmentView here: #6834 (comment) is applied, MetadataSegmentView should document its behavior in the face of the Coordinator being down, or just started, or leadership changed.

Currently, there is a single comment "Note that coordinator must be up to get segments" which, IMO, only adds FUD and doesn't explain anything.

Ideally, MetadataSegmentView should correctly recognize the situations of changed Coordinator's leadership and not to flush all cached published segments.

Explanation may look like the following:

/**
 * When Coordinator is just started or leadership changed,
 * its SegmentsMetadata is unpopulated. Then the endpoint /metadata/abc/foo/bar
 * which we are querying returns code XXX (see {@link DataSourcesResource#theRelevantMethod}).
 * We process this code here and don't flush {@link #cachedPublishedSegments} in this case.
 */

FYI @surekhasaharan

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions