private Metrics requireInitialization(Metrics metrics) {
        final Metrics cached = sessionCache.get(metrics);

        // All cached metrics, it at least had been written once.
        if (cached != null) {
            return cached;
        }

        // If the metrics do not have time bucket relative ID
        // it is treated as high dimensionality metrics.
        // Policy, always try load from the database when miss in the cache.
        if (!model.isTimeRelativeID()) {
            return null;
        }

        // When
        // (1) the time bucket of the server's latest stability status is provided
        //     1.1 The OAP has booted successfully
        //     1.2 The current dimensionality is in minute(timeOfLatestStabilitySts = 0 for other dimensionalities)
        //     1.3 The OAP cluster is rebalanced due to scaling
        // (2) the metrics are from the time after the timeOfLatestStabilitySts.
        // (3) the metrics don't exist in the cache.
        //The kernel should NOT try to load it from the database.
        //
        // Notice, about the condition (2),
        // For the specific minutes of metrics before booted, rebalanced(cluster) and expired from cache, 
        // they are expected to load from the database when don't exist in the cache.
        if (timeOfLatestStabilitySts > 0 &&
            metrics.getTimeBucket() > timeOfLatestStabilitySts) {
            final long currentTimeMillis = System.currentTimeMillis();
            long metricsTimestamp = TimeBucket.getTimestamp(metrics.getTimeBucket());
            if (currentTimeMillis - metricsTimestamp > storageSessionTimeout) {
                return null;
            }

            // Return metrics as input to avoid reading from database.
            return metrics;
        }

        return null;
    }
Check the metrics whether in the cache, and whether the worker should go further to load from database.

@param metrics the metrics in the streaming process.
@return metrics in cache or null if try to read the metrics from the database.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/MetricsPersistentWorker.java