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

Performance fix. Reduce deprecation calls for the same bulk request #37415

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

markharwood
Copy link
Contributor

Only log one types deprecation warning per bulk request.
Related to #37411

@markharwood markharwood added v7.0.0 >regression :Search Foundations/Mapping Index mappings, including merging and defining field types labels Jan 14, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@markharwood markharwood requested a review from colings86 January 14, 2019 12:11
if (typesDeprecationLogged == false) {
deprecationLogger.deprecatedAndMaybeLog("bulk_with_types", RestBulkAction.TYPES_DEPRECATION_MESSAGE);
typesDeprecationLogged = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a test that checks that only 1 deprecation warning is returned when the bulk request would previously generate multiple?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they're thinned out already in DeprecationLogger/ThreadContext?
It dedups values added to the response header
This PR just adds a more performant way of thinning them out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I see. In which case I think we should test to make sure this actually fixes the performance issue before we merge it as I didn't see that we already deduplicate the warning headers. Maybe we can run one of the rally tracks against this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll ask

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fix the drop.

With the earlier commit (4344305) geopoint default had the following indexing throughput:

|   All |                                                 Min Throughput | index-append |    216469 | docs/s |
|   All |                                              Median Throughput | index-append |    220417 | docs/s |
|   All |                                                 Max Throughput | index-append |    222044 | docs/s |

whereas with this commit:

|   All |                                                 Min Throughput | index-append |     302604 | docs/s |
|   All |                                              Median Throughput | index-append |     312456 | docs/s |
|   All |                                                 Max Throughput | index-append |     315466 | docs/s |

which seems to be roughly the same performance we had before the pending PR/commit i.e. using 04dcb13:


|   All |                                                 Min Throughput | index-append |    312749 | docs/s |
|   All |                                              Median Throughput | index-append |    316424 | docs/s |
|   All |                                                 Max Throughput | index-append |    318845 | docs/s |

For the record the Rally command in a 1node env with separate load generator:

rally --skip-update --configuration-name=adhoc --target-host="192.168.14.13:39200" --track="geopoint" --car="defaults" --challenge="append-no-conflicts" --user-tag="env:bare,name:geopoint-append-defaults-1node" --pipeline="from-sources-complete" --revision="4344305" --include-tasks="delete-index,create-index,check-cluster-health,index-append,refresh-after-index,force-merge,refresh-after-force-merge" --user-tag="geopoint:regression"

vs

rally --skip-update --configuration-name=adhoc --target-host="192.168.14.13:39200" --track="geopoint" --car="defaults" --challenge="append-no-conflicts" --user-tag="env:bare,name:geopoint-append-defaults-1node" --pipeline="from-sources-skip-build" --revision="72f71a0e" --include-tasks="delete-index,create-index,check-cluster-health,index-append,refresh-after-index,force-merge,refresh-after-force-merge" --user-tag="geopoint:fix"

Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some benchmark results.

if (typesDeprecationLogged == false) {
deprecationLogger.deprecatedAndMaybeLog("bulk_with_types", RestBulkAction.TYPES_DEPRECATION_MESSAGE);
typesDeprecationLogged = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fix the drop.

With the earlier commit (4344305) geopoint default had the following indexing throughput:

|   All |                                                 Min Throughput | index-append |    216469 | docs/s |
|   All |                                              Median Throughput | index-append |    220417 | docs/s |
|   All |                                                 Max Throughput | index-append |    222044 | docs/s |

whereas with this commit:

|   All |                                                 Min Throughput | index-append |     302604 | docs/s |
|   All |                                              Median Throughput | index-append |     312456 | docs/s |
|   All |                                                 Max Throughput | index-append |     315466 | docs/s |

which seems to be roughly the same performance we had before the pending PR/commit i.e. using 04dcb13:


|   All |                                                 Min Throughput | index-append |    312749 | docs/s |
|   All |                                              Median Throughput | index-append |    316424 | docs/s |
|   All |                                                 Max Throughput | index-append |    318845 | docs/s |

For the record the Rally command in a 1node env with separate load generator:

rally --skip-update --configuration-name=adhoc --target-host="192.168.14.13:39200" --track="geopoint" --car="defaults" --challenge="append-no-conflicts" --user-tag="env:bare,name:geopoint-append-defaults-1node" --pipeline="from-sources-complete" --revision="4344305" --include-tasks="delete-index,create-index,check-cluster-health,index-append,refresh-after-index,force-merge,refresh-after-force-merge" --user-tag="geopoint:regression"

vs

rally --skip-update --configuration-name=adhoc --target-host="192.168.14.13:39200" --track="geopoint" --car="defaults" --challenge="append-no-conflicts" --user-tag="env:bare,name:geopoint-append-defaults-1node" --pipeline="from-sources-skip-build" --revision="72f71a0e" --include-tasks="delete-index,create-index,check-cluster-health,index-append,refresh-after-index,force-merge,refresh-after-force-merge" --user-tag="geopoint:fix"

@markharwood markharwood merged commit 92c6c98 into elastic:master Jan 14, 2019
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 15, 2019
* master: (28 commits)
  Introduce retention lease serialization (elastic#37447)
  Update Delete Watch to allow unknown fields (elastic#37435)
  Make finalize step of recovery source non-blocking (elastic#37388)
  Update the default for include_type_name to false. (elastic#37285)
  Security: remove SSL settings fallback (elastic#36846)
  Adding mapping for hostname field (elastic#37288)
  Relax assertSameDocIdsOnShards assertion
  Reduce recovery time with compress or secure transport (elastic#36981)
  Implement ccr file restore (elastic#37130)
  Fix Eclipse specific compilation issue (elastic#37419)
  Performance fix. Reduce deprecation calls for the same bulk request (elastic#37415)
  [ML] Use String rep of Version in map for serialisation (elastic#37416)
  Cleanup Deadcode in Rest Tests (elastic#37418)
  Mute IndexShardRetentionLeaseTests.testCommit elastic#37420
  unmuted test
  Remove unused index store in directory service
  Improve CloseWhileRelocatingShardsIT (elastic#37348)
  Fix ClusterBlock serialization and Close Index API logic after backport to 6.x (elastic#37360)
  Update the scroll example in the docs (elastic#37394)
  Update analysis.asciidoc (elastic#37404)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>regression :Search Foundations/Mapping Index mappings, including merging and defining field types v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants