Skip to content

KAFKA-8190; Don't update keystore modification time during validation#6539

Merged
rajinisivaram merged 3 commits intoapache:trunkfrom
rajinisivaram:KAFKA-8190-keystore-update
Apr 5, 2019
Merged

KAFKA-8190; Don't update keystore modification time during validation#6539
rajinisivaram merged 3 commits intoapache:trunkfrom
rajinisivaram:KAFKA-8190-keystore-update

Conversation

@rajinisivaram
Copy link
Copy Markdown
Contributor

We currently store keystore file modification time when loading keystores in a SecurityStore instance. When dynamically updating keystores without filename change, we compare the time at the last load against the current file modification time. But we load keystore for validation of dynamic configs and as a result, we dont recreate SSLContext when performing actual reconfiguration after the validation. We always create a new SecurityStore instance for reconfiguration of the store, so we only need to store file modification time when we construct the instance.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@rajinisivaram rajinisivaram requested a review from omkreddy April 4, 2019 22:01
Copy link
Copy Markdown
Contributor

@omkreddy omkreddy left a comment

Choose a reason for hiding this comment

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

@rajinisivaram Thanks for the PR. Good find. LGTM.
looks like we don't have a test in DynamicBrokerReconfigurationTest to test this scenario.

@rajinisivaram
Copy link
Copy Markdown
Contributor Author

@omkreddy Thanks for the review. Updated DynamicBrokerReconfigurationTest to test this scenario. Can you take a look? Thanks.

@omkreddy
Copy link
Copy Markdown
Contributor

omkreddy commented Apr 5, 2019

Thanks for the update. LGTM.

@rajinisivaram
Copy link
Copy Markdown
Contributor Author

There was a test failure in one of the builds. Looks like this was because file modification time hadn't changed on the file. Updated test to change file modification time explicitly (I could recreate the failure by running in a loop and it passes reliably for me).

Also added info-level log entry for SSLContext update. For all config changes, we log at info-level in DynamicBrokerConfig. But since keystore update can happen without config change, it will be useful to have the reload logged at info level as well.

@omkreddy Can you review once more please? Sorry about that.

@omkreddy
Copy link
Copy Markdown
Contributor

omkreddy commented Apr 5, 2019

Thanks for the update. LGTM.

@rajinisivaram
Copy link
Copy Markdown
Contributor Author

@omkreddy Thanks for the reviews! Merging to trunk, 2.2 and 2.1. Build failure is unrelated (ConsumerBounceTest).

@rajinisivaram rajinisivaram merged commit 844120c into apache:trunk Apr 5, 2019
rajinisivaram added a commit that referenced this pull request Apr 5, 2019
…#6539)

Ensure that modification time is checked against the file used to create the SSLContext that is in-use so that SSLContext is updated whenever file is modified and a config update request is received.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
rajinisivaram added a commit that referenced this pull request Apr 5, 2019
…#6539)

Ensure that modification time is checked against the file used to create the SSLContext that is in-use so that SSLContext is updated whenever file is modified and a config update request is received.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
jarekr pushed a commit to confluentinc/kafka that referenced this pull request Apr 18, 2019
* apache/trunk:
  MINOR: Add security considerations for remote JMX in Kafka docs (apache#6544)
  MINOR: Remove redundant access specifiers from metrics interfaces (apache#6527)
  MINOR: Correct KStream documentation (apache#6552)
  KAFKA-8013; Avoid underflow when reading a Struct from a partially correct buffer (apache#6340)
  KAFKA-8058: Fix ConnectClusterStateImpl.connectors() method (apache#6384)
  MINOR: Move common consumer tests out of abstract consumer class (apache#6548)
  KAFKA-8168; Add a generated ApiMessageType class
  KAFKA-7893; Refactor ConsumerBounceTest to reuse functionality from BaseConsumerTest (apache#6238)
  MINOR: Tighten up metadata upgrade test (apache#6531)
  KAFKA-8190; Don't update keystore modification time during validation (apache#6539)
  MINOR: Fixed a few warning in core and connects (apache#6545)
  KAFKA-7904; Add AtMinIsr partition metric and TopicCommand option (KIP-427)
  MINOR: fix throttling and status in ConnectionStressWorker
  KAFKA-8090: Use automatic RPC generation in ControlledShutdown
  KAFKA-6399: Remove Streams max.poll.interval override (apache#6509)
  KAFKA-8126: Flaky Test org.apache.kafka.connect.runtime.WorkerTest.testAddRemoveTask (apache#6475)
  HOTFIX: Update unit test for KIP-443
  KAFKA-7190: KIP-443; Remove streams overrides on repartition topics (apache#6511)
  KAFKA-8183: Add retries to WorkerUtils#verifyTopics (apache#6532)
  KAFKA-8181: Removed Avro topic from TOC on kafka (apache#6529)
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…apache#6539)

Ensure that modification time is checked against the file used to create the SSLContext that is in-use so that SSLContext is updated whenever file is modified and a config update request is received.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
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