Skip to content

Commit

Permalink
Merge branch 'improvement/BB-436' into q/8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Sep 26, 2023
2 parents 88a256f + 4ed2a4f commit 4587c06
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 187 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Render and test lifecycle
uses: scality/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# TODO: remove the following step once Oras CLI 0.13.0 bug https://github.com/oras-project/oras/issues/447 is fixed.
- name: Downgrade Oras to 0.12.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v2
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
cache-to: type=gha,mode=max

- name: Build and push MongoDB
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: true
context: .github/dockerfiles/mongodb
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- 27019:27019
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
Expand Down
107 changes: 0 additions & 107 deletions conf/Config.js

This file was deleted.

61 changes: 0 additions & 61 deletions conf/config.joi.js

This file was deleted.

3 changes: 2 additions & 1 deletion conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"backlogMetrics": {
"zkPath": "/backbeat/run/kafka-backlog-metrics",
"intervalS": 60
}
},
"maxRequestSize": 5000020
},
"s3": {
"host": "127.0.0.1",
Expand Down
1 change: 1 addition & 0 deletions extensions/gc/GarbageCollectorProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class GarbageCollectorProducer {
setupProducer(cb) {
const producer = new BackbeatProducer({
kafka: { hosts: this._kafkaConfig.hosts },
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._topic,
});
producer.once('error', () => {});
Expand Down
1 change: 1 addition & 0 deletions extensions/lifecycle/LifecycleQueuePopulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class LifecycleQueuePopulator extends QueuePopulatorExtension {
}
const producer = new BackbeatProducer({
kafka: { hosts: this.kafkaConfig.hosts },
maxRequestSize: this.kafkaConfig.maxRequestSize,
topic,
});
producer.once('error', done);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ class LifecycleBucketProcessor {
_setupProducer(cb) {
const producer = new BackbeatProducer({
kafka: { hosts: this._kafkaConfig.hosts },
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._lcConfig.objectTasksTopic,
});
producer.once('error', err => {
Expand Down
1 change: 1 addition & 0 deletions extensions/lifecycle/conductor/LifecycleConductor.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ class LifecycleConductor {
_setupProducer(cb) {
const producer = new BackbeatProducer({
kafka: { hosts: this.kafkaConfig.hosts },
maxRequestSize: this.kafkaConfig.maxRequestSize,
topic: this.lcConfig.bucketTasksTopic,
});
producer.once('error', cb);
Expand Down
6 changes: 4 additions & 2 deletions extensions/oplogPopulator/OplogPopulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const Allocator = require('./modules/Allocator');
const ConnectorsManager = require('./modules/ConnectorsManager');
const { ZenkoMetrics } = require('arsenal').metrics;
const OplogPopulatorMetrics = require('./OplogPopulatorMetrics');
const { OplogPopulatorConfigJoiSchema } = require('./OplogPopulatorConfigValidator');
const { mongoJoi } = require('../../lib/config/configItems.joi');

const paramsJoi = joi.object({
config: joi.object().required(),
mongoConfig: joi.object().required(),
config: OplogPopulatorConfigJoiSchema.required(),
mongoConfig: mongoJoi.required(),
activeExtensions: joi.array().required(),
logger: joi.object().required(),
enableMetrics: joi.boolean().default(true),
Expand Down
5 changes: 4 additions & 1 deletion extensions/oplogPopulator/OplogPopulatorConfigValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ function configValidator(backbeatConfig, extConfig) {
return validatedConfig;
}

module.exports = configValidator;
module.exports = {
OplogPopulatorConfigJoiSchema: joiSchema,
OplogPopulatorConfigValidator: configValidator
};
2 changes: 1 addition & 1 deletion extensions/oplogPopulator/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const OplogPopulatorConfigValidator =
const { OplogPopulatorConfigValidator } =
require('./OplogPopulatorConfigValidator');

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions extensions/replication/failedCRR/FailedCRRProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class FailedCRRProducer {
setupProducer(cb) {
this._producer = new BackbeatProducer({
kafka: { hosts: this._kafkaConfig.hosts },
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._topic,
});
this._producer.once('error', () => {});
Expand Down
1 change: 1 addition & 0 deletions extensions/replication/queueProcessor/QueueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ class QueueProcessor extends EventEmitter {
_setupProducer(done) {
const producer = new BackbeatProducer({
kafka: { hosts: this.kafkaConfig.hosts },
maxRequestSize: this.kafkaConfig.maxRequestSize,
topic: this.repConfig.replicationStatusTopic,
});
producer.once('error', done);
Expand Down
1 change: 1 addition & 0 deletions extensions/replication/replay/ReplayProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ReplayProducer {
setupProducer(cb) {
this._producer = new BackbeatProducer({
kafka: { hosts: this._kafkaConfig.hosts },
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._topic,
});
this._producer.once('error', () => {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ class ReplicationStatusProcessor {
this.bucketNotificationConfig.topic;
const producer = new BackbeatProducer({
kafka: { hosts: this.kafkaConfig.hosts },
maxRequestSize: this.kafkaConfig.maxRequestSize,
topic: internalTopic,
});
producer.once('error', done);
Expand Down
10 changes: 5 additions & 5 deletions lib/BackbeatProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const KafkaBacklogMetrics = require('./KafkaBacklogMetrics');
const Constants = require('./constants');

const DEFAULT_POLL_INTERVAL = 2000;
const PRODUCER_MESSAGE_MAX_BYTES = 5000020;
const { KAFKA_PRODUCER_MESSAGE_MAX_BYTES } = require('./config.joi');
const FLUSH_TIMEOUT = 5000;


Expand Down Expand Up @@ -45,7 +45,7 @@ class BackbeatProducer extends EventEmitter {
}).required(),
topic: joi.string(),
pollIntervalMs: joi.number().default(DEFAULT_POLL_INTERVAL),
messageMaxBytes: joi.number().default(PRODUCER_MESSAGE_MAX_BYTES),
maxRequestSize: joi.number().default(KAFKA_PRODUCER_MESSAGE_MAX_BYTES),
}
);
}
Expand All @@ -65,7 +65,7 @@ class BackbeatProducer extends EventEmitter {
get producerConfig() {
return {
'metadata.broker.list': this._kafkaHosts,
'message.max.bytes': this._messageMaxBytes,
'message.max.bytes': this._maxRequestSize,
'dr_cb': true,
'compression.type': Constants.compressionType,
};
Expand Down Expand Up @@ -103,12 +103,12 @@ class BackbeatProducer extends EventEmitter {
kafka,
topic,
pollIntervalMs,
messageMaxBytes,
maxRequestSize,
} = joiResult;
this._kafkaHosts = kafka.hosts;
this._topic = topic && withTopicPrefix(topic);
this._pollIntervalMs = pollIntervalMs;
this._messageMaxBytes = messageMaxBytes;
this._maxRequestSize = maxRequestSize;
}

connect() {
Expand Down
2 changes: 1 addition & 1 deletion lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const path = require('path');
const crypto = require('crypto');

const extensions = require('../extensions');
const backbeatConfigJoi = require('./config.joi');
const { backbeatConfigJoi } = require('./config.joi');

const locationTypeMatch = {
'location-mem-v1': 'mem',
Expand Down
1 change: 1 addition & 0 deletions lib/MetricsProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class MetricsProducer {
setupProducer(done) {
const producer = new BackbeatProducer({
kafka: { hosts: this._kafkaConfig.hosts },
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._topic,
});
producer.once('error', done);
Expand Down
1 change: 1 addition & 0 deletions lib/api/BackbeatAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ class BackbeatAPI {
_setProducer(topic, cb) {
const producer = new BackbeatProducer({
kafka: { hosts: this._kafkaConfig.hosts },
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic,
});

Expand Down
Loading

0 comments on commit 4587c06

Please sign in to comment.