Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15019

Replica placement API needs a way to fetch existing replica metrics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • None

    Description

      Replica placement API was introduced in SOLR-14613. It offers a few sample (and simple) implementations of placement plugins.

      However, this API doesn't offer support for retrieving per-replica metrics, which are required for calculating more realistic placements. For example, when calculating placements for ADDREPLICA on an already existing collection the plugin should know what is the size of replica in order to avoid placing large replicas on nodes with insufficient free disk space.

      After discussing this with ilan we propose the following additions to the API:

      • use the existing AttributeFetcher interface as a facade for retrieving per-replica values (currently it only retrieves per-node values)
      • add ShardValues interface to represent strongly-typed API for key metrics, such as replica size, number of docs, number of update and search requests.

      Plugins could then use this API like this:

      AttributeFetcher attributeFetcher = ...
      SolrCollection solrCollection = ...
      Set<String> metricNames = ...
      attributeFetcher.requestCollectionMetrics(solrCollection, solrCollection.getShardNames(), metricNames);
      
      AttributeValues attributeValues = attributeFetcher.fetchAttributes();
      ShardValues shardValues = attributeValues.getShardMetrics(solrCollection.getName(), shardName);
      int sizeInGB = shardValues.getSizeInGB(); // retrieves shard leader metrics
      int replicaSizeInGB = shardValues.getSizeInGB(replica);
      

      Attachments

        Issue Links

          Activity

            People

              ab Andrzej Bialecki
              ab Andrzej Bialecki
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 9h 20m
                  9h 20m