Skip to content

[BUG] Lucene: defer vector-format dependency initialization until use #2614

Description

@nvzm123

Problem

Several cuvs-lucene KnnVectorsFormat providers resolve optional/version-specific implementations in eager static initializers. Lucene SPI discovery instantiates registered providers, so one initialization failure can poison unrelated codec resolution with ExceptionInInitializerError.

Proposed change

  • Defer provider and flat-format construction until fieldsReader or fieldsWriter is used.
  • Safely publish cached instances.
  • Preserve the original failure as the cause.
  • Add fresh-JVM SPI enumeration and side-effect-free construction coverage.

Keep public names, defaults, and persisted formats unchanged. In particular, the existing binary-quantized provider must retain its released legacy flat-vector layout until migration support is implemented separately.

Related to #2512.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions