Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiskUsages with negative total or free space are unserialisable #48413

Open
DaveCTurner opened this issue Oct 23, 2019 · 3 comments
Open

DiskUsages with negative total or free space are unserialisable #48413

DaveCTurner opened this issue Oct 23, 2019 · 3 comments
Assignees
Labels
>bug :Data Management/Stats Statistics tracking and retrieval APIs Team:Data Management Meta label for data/management team

Comments

@DaveCTurner
Copy link
Contributor

Today DiskUsage uses writeVLong() to write its sizes in bytes, so serialising a negative size results in an IllegalStateException.

One possible source of negative sizes was if the DiskThresholdDecider subtracted more relocating shards than the free space of the disk, and this is being addressed in #48392. This was benign since we never serialised the resulting DiskUsage objects. However according to DiskUsageTests we can get negative sizes in other ways too. I'm not sure this is true in Elasticsearch today, but it warrants a more careful investigation. Maybe we can fix the tests and then add assertions that the sizes are always non-negative, or maybe we need to fix the serialisation to deal with negative sizes.

@DaveCTurner DaveCTurner added >bug :Data Management/Stats Statistics tracking and retrieval APIs labels Oct 23, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Stats)

@rjernst rjernst added the Team:Data Management Meta label for data/management team label May 4, 2020
@RicardoGralhoz
Copy link

RicardoGralhoz commented Dec 2, 2020

Hey Dave,

I found this related exception on v7.8.1 when running the diagnostics tool to try to debug an unassigned shard issue with underlying CircuitBreakingException (indices:data/write/bulk). Restarting the cluster fixed the original issue, but I'm monitoring it for it seems recurrent.

Would you like me to share the support diagnostics file or should I open a new discussion on the forum, instead? Thanks!

cluster_stats.json :

Bad Request. Rejected
{
  "error" : { 
    "root_cause" : [ 
      {   
        "type" : "illegal_argument_exception",
        "reason" : "Values less than -1 bytes are not supported: -9223372036787056125b"
      }   
    ],  
    "type" : "illegal_argument_exception",
    "reason" : "Values less than -1 bytes are not supported: -9223372036787056125b",
    "suppressed" : [ 
      {   
        "type" : "illegal_state_exception",
        "reason" : "Failed to close the XContentBuilder",
        "caused_by" : { 
          "type" : "i_o_exception",
          "reason" : "Unclosed object or array found"
        }
      }   
    ]   
  },  
  "status" : 400 
}

@gmarouli gmarouli self-assigned this Mar 13, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Stats Statistics tracking and retrieval APIs Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

7 participants