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

Feature/zenko 266 ingestion consumer #332

Merged

Conversation

JianqinWang
Copy link
Contributor

Reopening #261 with updated branch name format for Bert-e

@bert-e
Copy link
Contributor

bert-e commented Jun 25, 2018

Hello JianqinWang,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get
information on this process.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Jun 25, 2018

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • 2 peers

@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

1 similar comment
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@JianqinWang JianqinWang force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 3b6789c to be1c564 Compare June 27, 2018 00:29
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@JianqinWang JianqinWang force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from be1c564 to 21fb915 Compare June 27, 2018 00:35
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@@ -1,9 +1,9 @@
const { usersBucket } = require('arsenal').constants;

const ObjectQueueEntry =
require('../../extensions/replication/utils/ObjectQueueEntry');
require('../../extensions/utils/ObjectQueueEntry');
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're moving those helper classes, let's move them to lib/models/ instead beside QueueEntry class.

@@ -5,7 +5,7 @@ const extensions = {};

fs.readdirSync(__dirname).forEach(moduleDir => {
const extStat = fs.statSync(path.join(__dirname, moduleDir));
if (extStat.isDirectory()) {
if (extStat.isDirectory() && moduleDir !== 'utils') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: if you move the helper classes to lib/models/ you should be able to get rid of this special case.

this._consumer = new BackbeatConsumer({
// zookeeper: { connectionString: this.zkConfig.connectionString },
topic: this.mongoProcessorConfig.topic,
groupId: `${this.mongoProcessorConfig.groupId}1`,
Copy link
Contributor

Choose a reason for hiding this comment

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

why suffixing with 1?

queueProcessor: this.processKafkaEntry.bind(this),
});
this._consumer.on('ready', () => {
this._consumer.subscribe();
Copy link
Contributor

Choose a reason for hiding this comment

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

Taylor recently added kubernetes healthcheck support, you would have to add the small support code around here to link to the healthcheck server (see changes in other backbeat components for examples, it should be almost a cut&paste).

this.logger, err => {
if (err) {
this.logger.error('error deleting object from mongo',
{ error: err });
Copy link
Contributor

Choose a reason for hiding this comment

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

{ bucket, key, error: err.message }

this.logger, err => {
if (err) {
this.logger.error('error putting to usersbucket',
{ error: err, bucketOwnerKey });
Copy link
Contributor

Choose a reason for hiding this comment

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

error: err.message

{ error: err, bucketOwnerKey });
return done(err);
}
this.logger.info('successfully put to usersBucket',
Copy link
Contributor

Choose a reason for hiding this comment

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

usersBucket is internal and should not be exposed in an info log. What about bucket entry put into mongo? Not convinced entry is the best wording, let you decide :)

return process.nextTick(done);
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

This is legacy code, please remove (now we can bootstrap by passing a bootstrap parameter to BackbeatConsumer class, but no need to deal with it if you don't use it in actual tests).

@@ -11,14 +11,14 @@ const RoundRobin = require('arsenal').network.RoundRobin;
const BackbeatProducer = require('../../../lib/BackbeatProducer');
const BackbeatConsumer = require('../../../lib/BackbeatConsumer');
const VaultClientCache = require('../../../lib/clients/VaultClientCache');
const QueueEntry = require('../../../lib/models/QueueEntry');
const QueueEntry = require('../../utils/QueueEntry');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a good reason to move this file?

*
* @param {object} objectMd - object info to format entry
* @param {string} bucketPrefix - prefix for bucketname to avoid name clash
* @return {object} JSON.stringified entry value to be sent to kafka
Copy link
Contributor

Choose a reason for hiding this comment

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

The description is a little bit off (or confusing), what is returned is a regular JS object that contains the stringified JSON kafka message as its value attribute.

@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@ironman-machine
Copy link
Contributor

CONFLICT (add/add): Merge conflict in tests/unit/api/BackbeatRequest.spec.js
CONFLICT (add/add): Merge conflict in tests/unit/api/BackbeatAPI.spec.js
CONFLICT (add/add): Merge conflict in tests/functional/replication/queueProcessor.js
CONFLICT (add/add): Merge conflict in tests/functional/api/BackbeatServer.js
CONFLICT (add/add): Merge conflict in tests/functional/BackbeatConsumer.js
CONFLICT (add/add): Merge conflict in package.json
CONFLICT (add/add): Merge conflict in lib/models/QueueEntry.js
CONFLICT (add/add): Merge conflict in lib/management/index.js
CONFLICT (add/add): Merge conflict in lib/clients/backbeat-2017-07-01.api.json
CONFLICT (add/add): Merge conflict in lib/api/BackbeatRequest.js
CONFLICT (add/add): Merge conflict in lib/api/BackbeatAPI.js
CONFLICT (add/add): Merge conflict in lib/MetricsProducer.js
CONFLICT (add/add): Merge conflict in lib/BackbeatConsumer.js
CONFLICT (add/add): Merge conflict in extensions/replication/tasks/UpdateReplicationStatus.js
CONFLICT (add/add): Merge conflict in extensions/replication/tasks/ReplicateObject.js
CONFLICT (add/add): Merge conflict in extensions/replication/tasks/MultipleBackendTask.js
CONFLICT (add/add): Merge conflict in extensions/replication/replicationStatusProcessor/ReplicationStatusProcessor.js
CONFLICT (add/add): Merge conflict in extensions/replication/queueProcessor/task.js
CONFLICT (add/add): Merge conflict in extensions/replication/queueProcessor/QueueProcessor.js
CONFLICT (add/add): Merge conflict in extensions/replication/management.js
CONFLICT (add/add): Merge conflict in extensions/replication/failedCRR/FailedCRRProducer.js
CONFLICT (add/add): Merge conflict in extensions/replication/ReplicationQueuePopulator.js
CONFLICT (add/add): Merge conflict in extensions/lifecycle/management.js
CONFLICT (add/add): Merge conflict in extensions/lifecycle/conductor/LifecycleConductor.js
CONFLICT (add/add): Merge conflict in extensions/index.js
CONFLICT (add/add): Merge conflict in eve/main.yml
CONFLICT (add/add): Merge conflict in conf/config.json
CONFLICT (add/add): Merge conflict in conf/Config.js
CONFLICT (add/add): Merge conflict in bin/queuePopulator.js

@bert-e
Copy link
Contributor

bert-e commented Jun 28, 2018

Conflict

There is a conflict between your branch feature/ZENKO-266-Ingestion-Consumer and the
destination branch development/8.0.

Please resolve the conflict on the feature branch (feature/ZENKO-266-Ingestion-Consumer).

#!bash
 $ git fetch
 $ git checkout origin/feature/ZENKO-266-Ingestion-Consumer
 $ git merge origin/development/8.0
 $ # <intense conflict resolution>
 $ git push origin HEAD:feature/ZENKO-266-Ingestion-Consumer

@JianqinWang JianqinWang force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 0f9b283 to ebf4831 Compare June 28, 2018 17:53
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@bert-e
Copy link
Contributor

bert-e commented Jun 28, 2018

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • 2 peers

@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@ironman-machine
Copy link
Contributor

CONFLICT (add/add): Merge conflict in package.json
CONFLICT (add/add): Merge conflict in lib/models/QueueEntry.js
CONFLICT (add/add): Merge conflict in lib/MetricsProducer.js
CONFLICT (add/add): Merge conflict in lib/BackbeatConsumer.js
CONFLICT (add/add): Merge conflict in extensions/replication/queueProcessor/QueueProcessor.js
CONFLICT (add/add): Merge conflict in extensions/replication/ReplicationQueuePopulator.js
CONFLICT (add/add): Merge conflict in extensions/index.js
CONFLICT (add/add): Merge conflict in conf/config.json

@JianqinWang JianqinWang force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from db9f42b to cf775c3 Compare June 29, 2018 18:07
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@ironman-machine
Copy link
Contributor

CONFLICT (add/add): Merge conflict in package.json
CONFLICT (add/add): Merge conflict in lib/models/QueueEntry.js
CONFLICT (add/add): Merge conflict in lib/MetricsProducer.js
CONFLICT (add/add): Merge conflict in lib/BackbeatConsumer.js
CONFLICT (add/add): Merge conflict in extensions/replication/queueProcessor/QueueProcessor.js
CONFLICT (add/add): Merge conflict in extensions/replication/ReplicationQueuePopulator.js
CONFLICT (add/add): Merge conflict in extensions/lifecycle/management.js
CONFLICT (add/add): Merge conflict in extensions/index.js
CONFLICT (add/add): Merge conflict in conf/config.json

@JianqinWang JianqinWang force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 3767165 to 1b29fd8 Compare June 30, 2018 00:36
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@JianqinWang JianqinWang force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 1b29fd8 to 5c3dae7 Compare June 30, 2018 00:45
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

1 similar comment
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@ironman-machine
Copy link
Contributor

CONFLICT (add/add): Merge conflict in package.json
CONFLICT (add/add): Merge conflict in lib/models/RaftLogEntry.js
CONFLICT (add/add): Merge conflict in lib/models/QueueEntry.js
CONFLICT (add/add): Merge conflict in lib/MetricsProducer.js
CONFLICT (add/add): Merge conflict in lib/BackbeatConsumer.js
CONFLICT (add/add): Merge conflict in extensions/replication/queueProcessor/QueueProcessor.js
CONFLICT (add/add): Merge conflict in extensions/replication/ReplicationQueuePopulator.js
CONFLICT (add/add): Merge conflict in conf/config.json

@rahulreddy rahulreddy force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 4f104e6 to 2676ffd Compare June 30, 2018 08:47
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@rahulreddy rahulreddy force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 2676ffd to da9f219 Compare June 30, 2018 09:06
@ironman-machine
Copy link
Contributor

PR has been updated. Reviewers, please be cautious.

@jonathan-gramain jonathan-gramain force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from da9f219 to 8cdb0f7 Compare June 30, 2018 21:59
*/
start() {
this.logger.info('starting mongo queue processor');
this._mongoClient.setup(err => {
Copy link
Contributor

Choose a reason for hiding this comment

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

i think with kube environment, and use of liveness probe, this is ok since the pod would just restart, but this could fail to start in other environments since we aren't waiting on each asynchronous setup of internal components

dump: config.log.dumpLevel });

mongoQueueProcessor.start();
healthServer.start();
Copy link
Contributor

Choose a reason for hiding this comment

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

this is missing setting onReadyCheck callback

groupId: `${this.mongoProcessorConfig.groupId}`,
// Must always have concurrency of 1 so writes are in order
kafka: { hosts: '127.0.0.1:9092' },
concurrency: 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm rather confident we can get rid of this limit for ingestion (likely cut&paste left-over, will remove w/ @rahulreddy 's benediction)

topic: this.mongoProcessorConfig.topic,
groupId: `${this.mongoProcessorConfig.groupId}`,
// Must always have concurrency of 1 so writes are in order
kafka: { hosts: '127.0.0.1:9092' },
Copy link
Contributor

Choose a reason for hiding this comment

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

This has to be configured via the global config object. Will fix

@jonathan-gramain jonathan-gramain force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 0952327 to 69343e4 Compare June 30, 2018 23:38
@bert-e
Copy link
Contributor

bert-e commented Jul 1, 2018

Build failed

The build for commit did not succeed in branch feature/ZENKO-266-Ingestion-Consumer.

Co-authored-by: Lauren Spiegel <lhspiegel@gmail.com>
@jonathan-gramain jonathan-gramain force-pushed the feature/ZENKO-266-Ingestion-Consumer branch from 69343e4 to 2c5b0a6 Compare July 1, 2018 00:46
@bert-e
Copy link
Contributor

bert-e commented Jul 1, 2018

Queue out of order

The changeset has received all authorizations to enter the merge queue,
however the merge queue is currently in an incoherent state. In order
to protect this pull-request, I have have not added the changeset to the
queue.

Please contact a member of release engineering.

@jonathan-gramain jonathan-gramain merged commit f579340 into development/8.0 Jul 1, 2018
@jonathan-gramain jonathan-gramain deleted the feature/ZENKO-266-Ingestion-Consumer branch July 1, 2018 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants