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

Check if GC config exists before creating gc producer in replication #2555

Open
wants to merge 5 commits into
base: development/8.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,16 @@
* in PEM format
* @param {Object} mConfig - metrics config
* @param {String} mConfig.topic - metrics config kafka topic
* @param {Boolean} enableGC - flag to enable garbage collection - Based on GC config
*/
constructor(kafkaConfig, sourceConfig, repConfig,
internalHttpsConfig, mConfig) {
internalHttpsConfig, mConfig, enableGC) {
KillianG marked this conversation as resolved.
Show resolved Hide resolved
this.kafkaConfig = kafkaConfig;
this.sourceConfig = sourceConfig;
this.repConfig = repConfig;
this.internalHttpsConfig = internalHttpsConfig;
this.mConfig = mConfig;
this.enableGC = enableGC;
this._consumer = null;
this._gcProducer = null;
this._mProducer = null;
Expand Down Expand Up @@ -369,9 +371,13 @@
done);
});
},
done => {

Check warning on line 374 in extensions/replication/replicationStatusProcessor/ReplicationStatusProcessor.js

View workflow job for this annotation

GitHub Actions / tests

Expected to return a value at the end of arrow function
this._gcProducer = new GarbageCollectorProducer();
this._gcProducer.setupProducer(done);
if (this.enableGC) {
this._gcProducer = new GarbageCollectorProducer();
this._gcProducer.setupProducer(done);
} else {
return done();
}
KillianG marked this conversation as resolved.
Show resolved Hide resolved
},
done => {
this._mProducer = new MetricsProducer(this.kafkaConfig,
Expand Down
3 changes: 2 additions & 1 deletion extensions/replication/replicationStatusProcessor/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ const repConfig = config.extensions.replication;
const sourceConfig = repConfig.source;
const internalHttpsConfig = config.internalHttps;
const mConfig = config.metrics;
const gcEnabled = config.extensions.gc;
KillianG marked this conversation as resolved.
Show resolved Hide resolved

const { initManagement } = require('../../../lib/management/index');

const replicationStatusProcessor = new ReplicationStatusProcessor(
kafkaConfig, sourceConfig, repConfig, internalHttpsConfig, mConfig);
kafkaConfig, sourceConfig, repConfig, internalHttpsConfig, mConfig, gcEnabled);

werelogs.configure({ level: config.log.logLevel,
dump: config.log.dumpLevel });
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/replication/queueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ describe('queue processor functional tests with mocking', () => {
objectSizeMetrics: [100, 1000],
},
{},
{ topic: 'metrics-test-topic' });
{ topic: 'metrics-test-topic' }, true);
replicationStatusProcessor.start({ bootstrap: true }, done);
},
done => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/replication/ReplicationStatusProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function makeReplicationStatusProcessor(replayTopics) {
transport: 'http',
},
{ replayTopics, objectSizeMetrics: [100, 1000] },
{});
{}, false);
KillianG marked this conversation as resolved.
Show resolved Hide resolved
}

describe('ReplicationStatusProcessor', () => {
Expand Down
Loading