Skip to content

Conversation

@chetanmeh
Copy link
Member

Switches to Cosmos SDK v3 which is the next supported SDK for using ChangeFeedProcessor support

Closes #4663

Related issue and scope

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

.feedContainer(targetContainer)
.leaseContainer(leaseContainer)
.options(feedOpts)
.asInstanceOf[ChangeFeedProcessorBuilderImpl] //observerFactory is not exposed hence need to cast to impl
Copy link
Member Author

Choose a reason for hiding this comment

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

Opened Azure/azure-sdk-for-java#5744 to expose the proper api so that we do not have to rely on implementation details

@chetanmeh chetanmeh force-pushed the cache-invalidator-v3 branch from 8e900f8 to 6812ae7 Compare October 12, 2019 08:10
@chetanmeh chetanmeh requested a review from tysonnorris October 14, 2019 11:56
@codecov-io
Copy link

codecov-io commented Oct 14, 2019

Codecov Report

Merging #4677 into master will decrease coverage by 4.7%.
The diff coverage is 12.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4677      +/-   ##
==========================================
- Coverage   83.05%   78.34%   -4.71%     
==========================================
  Files         189      196       +7     
  Lines        8555     8803     +248     
  Branches      597      603       +6     
==========================================
- Hits         7105     6897     -208     
- Misses       1450     1906     +456
Impacted Files Coverage Δ
...ore/database/cosmosdb/cache/CacheInvalidator.scala 0% <0%> (-100%) ⬇️
...tabase/cosmosdb/cache/CacheInvalidatorConfig.scala 0% <0%> (-94.74%) ⬇️
.../openwhisk/core/database/cosmosdb/cache/Main.scala 0% <0%> (ø) ⬆️
...e/database/cosmosdb/cache/KafkaEventProducer.scala 0% <0%> (-76.48%) ⬇️
...e/database/cosmosdb/cache/ChangeFeedConsumer.scala 0% <0%> (ø)
...nwhisk/core/database/RemoteCacheInvalidation.scala 80% <100%> (ø) ⬆️
...base/cosmosdb/cache/WhiskChangeEventObserver.scala 50% <28.57%> (-50%) ⬇️
...core/database/cosmosdb/RxObservableImplicits.scala 0% <0%> (-100%) ⬇️
...core/database/cosmosdb/CosmosDBArtifactStore.scala 0% <0%> (-96.61%) ⬇️
...sk/core/database/cosmosdb/CosmosDBViewMapper.scala 0% <0%> (-93.8%) ⬇️
... and 48 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00cf75a...6320ec9. Read the comment docs.

@chetanmeh
Copy link
Member Author

For some reason the CacheInvalidatorTest is still failing in fork where CosmosDB tests are enabled. So need to validate that

@chetanmeh chetanmeh force-pushed the cache-invalidator-v3 branch 2 times, most recently from a87c462 to b8ee869 Compare October 18, 2019 04:26
@chetanmeh
Copy link
Member Author

Build passed on fork with CosmosDB tests enabled

@chetanmeh chetanmeh force-pushed the cache-invalidator-v3 branch from 5b5f919 to c460f4f Compare October 21, 2019 12:43
import java.util

import akka.Done
import akka.event.slf4j.SLF4JLogging
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason this shouldn't use the same Logging/AkkaLogging classes from common/scala? I guess this applies to all the other classes in cacheinvalidator.

Copy link
Member Author

Choose a reason for hiding this comment

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

In most cases (except the one to log the progress) the logs were mostly for lifecycle related messages (startup/shutdown) and the CosmosDB SDK also logs using slf4j directly so either of those logging should be fine.

Switched to AkkaLogging now for consistency

case Success(_) =>
MetricEmitter.emitCounterMetric(feedCounter, docs.size)
recordLag(context, docs.last)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should we log something on failures here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Logging was being done by CosmosDB SDK for failure but added a log here also now such that we can always capture the failure case

Copy link
Contributor

@tysonnorris tysonnorris left a comment

Choose a reason for hiding this comment

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

LGTM some minor comments

@chetanmeh chetanmeh merged commit f69ecb7 into apache:master Oct 22, 2019
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.

Use CosmosDB v3 SDK for Cache Invalidator Service

4 participants