Skip to content

Significant performance improvements to QtreeExists query or other wildcard based queries #1142

@ashokmuthyalapati

Description

@ashokmuthyalapati

Describe the solution you'd like

In the ontap-nas-economy driver, Trident checks qtree existence before create/publish flows using:

func (c *RestClient) QtreeExists(ctx context.Context, name, volumePattern string) (bool, string, error)

The current REST lookup path can become a major latency bottleneck on large clusters (especially with high qtree counts), causing noticeable end-to-end delay before storage is usable.

Specifically, QtreeExists issues a filtered qtree query using name + svm.uuid + volume.name=, and this operation can take tens of seconds on some ONTAP systems.

Requested change: optimize QtreeExists logic to reduce lookup latency at scale.

Describe alternatives you've considered
An alternative approach that performs significantly better in our testing:

  • Fetch qtree collections directly (paged).
  • Check for qtree match in-memory while iterating pages.
  • Stop paging early when a match is found.
  • If no match is found, finish pagination and return not found.
  • Even in cases where full pagination is needed, this approach is consistently faster than the current filtered QtreeExists path in our environments.

Additional context
We validated this across a large internal ONTAP footprint and observed ~10x–15x latency improvement after changing the lookup strategy.

In one representative case:

  • Current QtreeExists path: ~64s
  • Alternative paged scan approach: substantially lower latency (consistent with the 10x–15x improvement range)
    This delay directly impacts user experience for provisioning workflows in Trident.

Why this matters

  • Reduces PVC/provisioning startup lag for end users.
  • Improves perceived responsiveness of ontap-nas-economy.
  • Helps large-scale clusters where qtree metadata operations are a dominant control-plane latency source.

You may want to test the performance of other functions in Trident that use a wildcard style query on ONTAP. Multiple functions appear to use wildcard based pattern search/query.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions