Skip to content

Commit

Permalink
sinkType: Async and enableSingleThreadPool: false by default in peer …
Browse files Browse the repository at this point in the history
…nodes too (#231)

Added more compose unit tests.
Fxies #217
  • Loading branch information
fboucquez authored Apr 9, 2021
1 parent 012ff0f commit 76d246e
Show file tree
Hide file tree
Showing 20 changed files with 359 additions and 53 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
- Fixed host override when no custom preset is provided in mainnet.
- Fixed case issue validating keys when creating certificates.
- Updated Wallet to latest 1.0.1 release.
- Node properties sinkType: Async and enableSingleThreadPool: false by default in peer nodes too.
- Dropped NodeJS 10 support. Added Node LTS and Stable Support.

## [1.0.3] - Mar-31-2021
Expand Down
2 changes: 2 additions & 0 deletions presets/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ unconfirmedTransactionsCacheMaxResponseSize: 5MB
unconfirmedTransactionsCacheMaxSize: 20MB
connectTimeout: 15s
syncTimeout: 20m
enableSingleThreadPool: false
sinkType: Async
socketWorkingBufferSize: 16KB
socketWorkingBufferSensitivity: 1
maxPacketDataSize: 150MB
Expand Down
7 changes: 6 additions & 1 deletion src/model/ConfigPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ export enum DebugLevel {
max = 'Max',
}

export enum SinkType {
async = 'Async',
sync = 'Sync',
}

export interface NodeConfigPreset {
syncsource: boolean;
filespooling: boolean;
partialtransaction: boolean;
sinkType: 'Async' | 'Sync';
sinkType: SinkType;
enableSingleThreadPool: boolean;
addressextraction: boolean;
mongo: boolean;
Expand Down
17 changes: 5 additions & 12 deletions src/service/ConfigLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,39 +430,32 @@ export class ConfigLoader {
syncsource: true,
filespooling: true,
partialtransaction: true,
openPort: true,
sinkType: 'Async',
enableSingleThreadPool: false,
addressextraction: true,
enableAutoSyncCleanup: false,
mongo: true,
zeromq: true,
enableAutoSyncCleanup: false,
};
}
if (node.api) {
return {
sinkType: 'Async',
syncsource: false,
filespooling: true,
partialtransaction: true,
enableSingleThreadPool: false,
addressextraction: true,
mongo: true,
zeromq: true,
enableAutoSyncCleanup: false,
};
}
//peer only (harvesting or not).
// peer only (harvesting or not).
return {
sinkType: 'Sync',
enableSingleThreadPool: true,
syncsource: true,
filespooling: false,
partialtransaction: false,
addressextraction: false,
mongo: false,
zeromq: false,
syncsource: true,
filespooling: false,
enableAutoSyncCleanup: true,
partialtransaction: false,
};
}

Expand Down
66 changes: 66 additions & 0 deletions test/composes/expected-mainnet-api-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: '2.4'
services:
db:
user: '1000:1000'
environment:
MONGO_INITDB_DATABASE: catapult
container_name: db
image: 'mongo:4.4.3-bionic'
command: mongod --dbpath=/dbdata --bind_ip=db --wiredTigerCacheSizeGB 2
stop_signal: SIGINT
working_dir: /docker-entrypoint-initdb.d
volumes:
- './mongo:/docker-entrypoint-initdb.d:ro'
- '../databases/db:/dbdata:rw'
node:
user: '1000:1000'
container_name: node
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true
stop_signal: SIGINT
working_dir: /symbol-workdir
restart: 'on-failure:2'
ports:
- '7900:7900'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
depends_on:
- db
- broker
broker:
user: '1000:1000'
container_name: broker
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
working_dir: /symbol-workdir
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL
stop_signal: SIGINT
restart: 'on-failure:2'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
depends_on:
- db
rest-gateway:
container_name: rest-gateway
user: '1000:1000'
image: 'symbolplatform/symbol-rest:2.3.5'
command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json
stop_signal: SIGINT
working_dir: /symbol-workdir
ports:
- '3000:3000'
restart: 'on-failure:2'
volumes:
- '../gateways/rest-gateway:/symbol-workdir:rw'
depends_on:
- db
networks:
default:
ipv4_address: 172.20.0.25
networks:
default:
ipam:
config:
-
subnet: 172.20.0.0/24
66 changes: 66 additions & 0 deletions test/composes/expected-mainnet-dual-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: '2.4'
services:
db:
user: '1000:1000'
environment:
MONGO_INITDB_DATABASE: catapult
container_name: db
image: 'mongo:4.4.3-bionic'
command: mongod --dbpath=/dbdata --bind_ip=db --wiredTigerCacheSizeGB 2
stop_signal: SIGINT
working_dir: /docker-entrypoint-initdb.d
volumes:
- './mongo:/docker-entrypoint-initdb.d:ro'
- '../databases/db:/dbdata:rw'
node:
user: '1000:1000'
container_name: node
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true
stop_signal: SIGINT
working_dir: /symbol-workdir
restart: 'on-failure:2'
ports:
- '7900:7900'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
depends_on:
- db
- broker
broker:
user: '1000:1000'
container_name: broker
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
working_dir: /symbol-workdir
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL
stop_signal: SIGINT
restart: 'on-failure:2'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
depends_on:
- db
rest-gateway:
container_name: rest-gateway
user: '1000:1000'
image: 'symbolplatform/symbol-rest:2.3.5'
command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json
stop_signal: SIGINT
working_dir: /symbol-workdir
ports:
- '3000:3000'
restart: 'on-failure:2'
volumes:
- '../gateways/rest-gateway:/symbol-workdir:rw'
depends_on:
- db
networks:
default:
ipv4_address: 172.20.0.25
networks:
default:
ipam:
config:
-
subnet: 172.20.0.0/24
21 changes: 21 additions & 0 deletions test/composes/expected-mainnet-peer-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '2.4'
services:
node:
user: '1000:1000'
container_name: node
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL false
stop_signal: SIGINT
working_dir: /symbol-workdir
restart: 'on-failure:2'
ports:
- '7900:7900'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
networks:
default:
ipam:
config:
-
subnet: 172.20.0.0/24
66 changes: 66 additions & 0 deletions test/composes/expected-testnet-api-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: '2.4'
services:
db:
user: '1000:1000'
environment:
MONGO_INITDB_DATABASE: catapult
container_name: db
image: 'mongo:4.4.3-bionic'
command: mongod --dbpath=/dbdata --bind_ip=db --wiredTigerCacheSizeGB 2
stop_signal: SIGINT
working_dir: /docker-entrypoint-initdb.d
volumes:
- './mongo:/docker-entrypoint-initdb.d:ro'
- '../databases/db:/dbdata:rw'
node:
user: '1000:1000'
container_name: node
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true
stop_signal: SIGINT
working_dir: /symbol-workdir
restart: 'on-failure:2'
ports:
- '7900:7900'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
depends_on:
- db
- broker
broker:
user: '1000:1000'
container_name: broker
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
working_dir: /symbol-workdir
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL
stop_signal: SIGINT
restart: 'on-failure:2'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
depends_on:
- db
rest-gateway:
container_name: rest-gateway
user: '1000:1000'
image: 'symbolplatform/symbol-rest:2.3.5'
command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json
stop_signal: SIGINT
working_dir: /symbol-workdir
ports:
- '3000:3000'
restart: 'on-failure:2'
volumes:
- '../gateways/rest-gateway:/symbol-workdir:rw'
depends_on:
- db
networks:
default:
ipv4_address: 172.20.0.25
networks:
default:
ipam:
config:
-
subnet: 172.20.0.0/24
21 changes: 21 additions & 0 deletions test/composes/expected-testnet-peer-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '2.4'
services:
node:
user: '1000:1000'
container_name: node
image: 'symbolplatform/symbol-server:gcc-1.0.0.0'
command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL false
stop_signal: SIGINT
working_dir: /symbol-workdir
restart: 'on-failure:2'
ports:
- '7900:7900'
volumes:
- '../nodes/node:/symbol-workdir:rw'
- './server:/symbol-commands:ro'
networks:
default:
ipam:
config:
-
subnet: 172.20.0.0/24
8 changes: 4 additions & 4 deletions test/reports/bootstrap-voting/peer-node-0-config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ file.component.levels

config-logging-recovery.properties
console
sinkType; Sync
sinkType; Async
level; Info
colorMode; Ansi

Expand All @@ -133,14 +133,14 @@ file.component.levels

config-logging-server.properties
console
sinkType; Sync
sinkType; Async
level; Info
colorMode; Ansi

console.component.levels

file
sinkType; Sync
sinkType; Async
level; Info
directory; logs
filePattern; logs/catapult_server%4N.log
Expand Down Expand Up @@ -255,7 +255,7 @@ node
port; 7900; unsigned short; Server port.
maxIncomingConnectionsPerIdentity; 6; uint32_t; Maximum number of incoming connections per identity over primary port.
enableAddressReuse; false; bool; Set to true if the server should reuse ports already in use.
enableSingleThreadPool; true; bool; Set to true if a single thread pool should be used, Set to false if multiple thread pools should be used.
enableSingleThreadPool; false; bool; Set to true if a single thread pool should be used, Set to false if multiple thread pools should be used.
enableCacheDatabaseStorage; true; bool; Set to true if cache data should be saved in a database.
enableAutoSyncCleanup; true; bool; Set to true if temporary sync files should be automatically cleaned up. Note: This should be Set to false if broker process is running.
fileDatabaseBatchSize; 1; ;
Expand Down
8 changes: 4 additions & 4 deletions test/reports/bootstrap-voting/peer-node-0-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ config-logging-recovery.properties
:delim: ;

**console**;
sinkType; Sync
sinkType; Async
level; Info
colorMode; Ansi
**console.component.levels**;
Expand All @@ -167,12 +167,12 @@ config-logging-server.properties
:delim: ;

**console**;
sinkType; Sync
sinkType; Async
level; Info
colorMode; Ansi
**console.component.levels**;
**file**;
sinkType; Sync
sinkType; Async
level; Info
directory; logs
filePattern; logs/catapult_server%4N.log
Expand Down Expand Up @@ -286,7 +286,7 @@ config-node.properties
port; 7900; unsigned short; Server port.
maxIncomingConnectionsPerIdentity; 6; uint32_t; Maximum number of incoming connections per identity over primary port.
enableAddressReuse; false; bool; Set to true if the server should reuse ports already in use.
enableSingleThreadPool; true; bool; Set to true if a single thread pool should be used, Set to false if multiple thread pools should be used.
enableSingleThreadPool; false; bool; Set to true if a single thread pool should be used, Set to false if multiple thread pools should be used.
enableCacheDatabaseStorage; true; bool; Set to true if cache data should be saved in a database.
enableAutoSyncCleanup; true; bool; Set to true if temporary sync files should be automatically cleaned up. Note: This should be Set to false if broker process is running.
fileDatabaseBatchSize; 1; ;
Expand Down
Loading

0 comments on commit 76d246e

Please sign in to comment.