Skip to content

ByteSizeCachingDirectory can't use cached size because numOpenOutputs is a negative value when close method was invoked more than once #92434

@loupipalien

Description

@loupipalien

Elasticsearch Version

7.10.2

Installed Plugins

repository-hdfs

Java Version

bundled

OS Version

Linux 4.14.81.bm.26-amd64 #1 SMP Debian 4.14.81.bm.26 Mon Sep 14 09:46:45 UTC 2020

Problem Description

The size of shard should't be computed again instead of using cached when no pending write。we migrated a lot of indicess to a new cluster by snapshot, nodes and indices stats api become very slow because some shards that were restored from snapshots always computed shard directory size even no write,not use cached because the numOpenOutputs was decreased to a negative number

Steps to Reproduce

snapshot a index then restore, the shard that recovery from snapshot will always compute directory size instead of using cached

Logs (if relevant)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions