Skip to content

Improve concurrency of ShardCoreKeyMap.#22316

Merged
jpountz merged 1 commit intoelastic:masterfrom
jpountz:enhancement/improve_concurrency_of_ShardCoreKeyMap
Dec 22, 2016
Merged

Improve concurrency of ShardCoreKeyMap.#22316
jpountz merged 1 commit intoelastic:masterfrom
jpountz:enhancement/improve_concurrency_of_ShardCoreKeyMap

Conversation

@jpountz
Copy link
Copy Markdown
Contributor

@jpountz jpountz commented Dec 21, 2016

ShardCoreKeyMap.add is called on each segment for all search requests, which
means it might become a bottleneck under a cocurrent load of cheap search
requests since this method acquires a mutex. This change proposes to use a
ConcurrentHashMap which allows to only take the mutex in the case that the
LeafReader has never been seen before.

`ShardCoreKeyMap.add` is called on each segment for all search requests, which
means it might become a bottleneck under a cocurrent load of cheap search
requests since this method acquires a mutex. This change proposes to use a
`ConcurrentHashMap` which allows to only take the mutex in the case that the
`LeafReader` has never been seen before.
@jpountz jpountz added :Search/Search Search-related issues that do not fall into other categories >enhancement v5.2.0 v6.0.0-alpha1 labels Dec 21, 2016
Copy link
Copy Markdown
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

Basically double-checked locking, and very-well commented so it's maintained. LGTM.

@jpountz jpountz merged commit fd6e1a3 into elastic:master Dec 22, 2016
@jpountz jpountz deleted the enhancement/improve_concurrency_of_ShardCoreKeyMap branch December 22, 2016 13:34
jpountz added a commit that referenced this pull request Dec 22, 2016
`ShardCoreKeyMap.add` is called on each segment for all search requests, which
means it might become a bottleneck under a cocurrent load of cheap search
requests since this method acquires a mutex. This change proposes to use a
`ConcurrentHashMap` which allows to only take the mutex in the case that the
`LeafReader` has never been seen before.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Dec 22, 2016
* master: (22 commits)
  Support negative numbers in writeVLong (elastic#22314)
  UnicastZenPing's PingingRound should prevent opening connections after being closed
  Add task to clean idea build directory. Make cleanIdea task invoke it.
  add trace logging to UnicastZenPingTests.testResolveReuseExistingNodeConnections
  Adds ingest processor headers to exception for unknown processor. (elastic#22315)
  Remove much ceremony from parsing client yaml test suites (elastic#22311)
  Support numeric bounds with decimal parts for long/integer/short/byte datatypes (elastic#21972)
  inner hits: Don't inline inner hits if the query the inner hits is inlined into can't resolve mappings and ignore_unmapped has been set to true
  Fix stackoverflow error on InternalNumericMetricAggregation
  Date detection should not rely on a hardcoded set of characters. (elastic#22171)
  `value_type` is useful regardless of scripting. (elastic#22160)
  Improve concurrency of ShardCoreKeyMap. (elastic#22316)
  fixed jdocs and removed already fixed norelease
  Adds abstract test classes for serialisation (elastic#22281)
  Introduce translog no-op
  Provide helpful error message if a plugin exists
  Clear static variable after suite
  Repeated language analyzers (elastic#22240)
  Restore deprecation warning for invalid match_mapping_type values (elastic#22304)
  Make `-0` compare less than `+0` consistently. (elastic#22173)
  ...
jpountz added a commit that referenced this pull request Dec 29, 2016
`ShardCoreKeyMap.add` is called on each segment for all search requests, which
means it might become a bottleneck under a cocurrent load of cheap search
requests since this method acquires a mutex. This change proposes to use a
`ConcurrentHashMap` which allows to only take the mutex in the case that the
`LeafReader` has never been seen before.
RickyLau added a commit to ElasticsearchClub/elasticsearch that referenced this pull request Mar 12, 2019
Improve concurrency of ShardCoreKeyMap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Search/Search Search-related issues that do not fall into other categories v5.1.2 v5.2.0 v6.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants