Skip to content

SOLR-13608: Sync on TrackingBackupRepo NL changes#59

Merged
gerlowskija merged 1 commit intoapache:mainfrom
gerlowskija:SOLR_13608_synchronize_modification_of_trackingrepo_config
Apr 6, 2021
Merged

SOLR-13608: Sync on TrackingBackupRepo NL changes#59
gerlowskija merged 1 commit intoapache:mainfrom
gerlowskija:SOLR_13608_synchronize_modification_of_trackingrepo_config

Conversation

@gerlowskija
Copy link
Copy Markdown
Contributor

Description

BackupRepositoryFactory has a special case in its 'newInstance' method.
For 'TrackingBackupRepository' instances, BRF will modify a NamedList
representing the TBF config - adding references to the
SolrResourceLoader and to BRF itself.

In isolation this is innocuous, but becomes a problem when
BRF.newInstance is called concurrently from different threads. Threads
can race to set these NamedList keys, corrupting the NamedList in the
process. (i.e. NamedList values ended up in 'key' indices, and vice
versa)

Solution

This commit adds synchronization to this NL initialization, to ensure
that the NL values are only set by a single thread.

Tests

This PR itself is a fix for LocalFSCloudIncrementalBackupTest. It can be validated by beasting that test class to ensure the flakiness has been resolved.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

BackupRepositoryFactory has a special case in its 'newInstance' method.
For 'TrackingBackupRepository' instances, BRF will modify a NamedList
representing the TBF config - adding references to the
SolrResourceLoader and to BRF itself.

In isolation this is innocuous, but becomes a problem when
BRF.newInstance is called concurrently from different threads.  Threads
can race to set these NamedList keys, corrupting the NamedList in the
process.  (i.e. NamedList values ended up in 'key' indices, and vice
versa)

This commit adds synchronization to this NL initialization, to ensure
that the NL values are only set by a single thread.
@gerlowskija gerlowskija merged commit 06fad78 into apache:main Apr 6, 2021
@gerlowskija gerlowskija deleted the SOLR_13608_synchronize_modification_of_trackingrepo_config branch April 6, 2021 11:53
epugh pushed a commit to epugh/solr that referenced this pull request Oct 22, 2021
BackupRepositoryFactory has a special case in its 'newInstance' method.
For 'TrackingBackupRepository' instances, BRF will modify a NamedList
representing the TBF config - adding references to the
SolrResourceLoader and to BRF itself.

In isolation this is innocuous, but becomes a problem when
BRF.newInstance is called concurrently from different threads.  Threads
can race to set these NamedList keys, corrupting the NamedList in the
process.  (i.e. NamedList values ended up in 'key' indices, and vice
versa)

This commit adds synchronization to this NL initialization, to ensure
that the NL values are only set by a single thread.
chatman pushed a commit to fullstorydev/solr that referenced this pull request Jun 13, 2022
    * port changes fromnoble/prometheus-stats
    * Read CoreContainer directly from HttpServletRequest

    Co-authored-by: Noble Paul <noble@apache.org>
hiteshk25 referenced this pull request in cowpaths/fullstory-solr Oct 14, 2022
* port changes fromnoble/prometheus-stats
* Read CoreContainer directly from HttpServletRequest

Co-authored-by: Ishan Chattopadhyaya <ishan@apache.org>
hiteshk25 referenced this pull request in cowpaths/fullstory-solr Nov 1, 2022
* port changes fromnoble/prometheus-stats
* Read CoreContainer directly from HttpServletRequest

Co-authored-by: Ishan Chattopadhyaya <ishan@apache.org>
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.

1 participant