Skip to content

Fix Stats aggregate sum change type to nullable#4082

Closed
JefStat wants to merge 1 commit intoelastic:masterfrom
JefStat:fix_nullable_sum
Closed

Fix Stats aggregate sum change type to nullable#4082
JefStat wants to merge 1 commit intoelastic:masterfrom
JefStat:fix_nullable_sum

Conversation

@JefStat
Copy link
Copy Markdown
Contributor

@JefStat JefStat commented Sep 9, 2019

Encountered a bug on production due to this response data. Note the production cluster is running Elasticsearch 6.8

{
          "key" : "Morning 0",
          "doc_count" : 17,
          "subStatsAgg" : {
            "meta" : {
              "aggType" : "Sum"
            },
            "count" : 0,
            "min" : null,
            "max" : null,
            "avg" : null,
            "sum" : null
          }
        }

@russcam
Copy link
Copy Markdown
Contributor

russcam commented Sep 18, 2019

@JefStat which version of the client are you using against Elasticsearch 6.8.0?

Stats aggregate was changed in 7.0.0-beta1 of Elasticsearch to return sum of 0 when the count is 0 in elastic/elasticsearch#27193, so the client was updated in 4f64167 to reflect this in master and 7.x. The 6.x client still treats it as double?:

var sum = reader.Value as double?;

Are you using a 7.x client with 6.8, by chance?

@JefStat
Copy link
Copy Markdown
Contributor Author

JefStat commented Sep 18, 2019

Are you using a 7.x client with 6.8, by chance?

Yes, we are. This is a temporary state before doing a rolling upgrade on Elasticsearch. I tested running the NEST 6.8 client on 7.3 Cluster and it did not work on several issues.

@JefStat
Copy link
Copy Markdown
Contributor Author

JefStat commented Sep 19, 2019

I see a blog post has been released to partly address our issue https://www.elastic.co/blog/nest-and-elasticsearch-net-upgrading-your-codebase I can extrapolate from there

@JefStat JefStat closed this Sep 19, 2019
@JefStat JefStat deleted the fix_nullable_sum branch September 19, 2019 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants