Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions .github/workflows/aurora_performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 50

- name: "Set up JDK 8"
uses: actions/setup-java@v3
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "corretto"
java-version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Install dependencies
run: npm install --no-save

- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: nodejs_aurora_perf_tests
Expand All @@ -59,7 +59,7 @@ jobs:
- name: "Get Github Action IP"
if: always()
id: ip
uses: haythem/public-ip@v1.3
uses: haythem/public-ip@bdddd92c198b0955f0b494a8ebeac529754262ff # v1.3

- name: "Remove Github Action IP"
if: always()
Expand All @@ -73,7 +73,7 @@ jobs:

- name: Archive Performance results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.db }}-performance-results
path: ./tests/integration/container/reports
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
versions: [ "default", "latest" ]
dbEngine: ["aurora-mysql", "aurora-postgres" ]
dbEngine: ["aurora-mysql", "aurora-postgres", "multi-az-mysql", "multi-az-postgres" ]

steps:
- name: Clone repository
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
run-checks-and-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Install dependencies
run: npm install --no-save
- name: Run eslint - linting
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
packages: write
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: "Set up Node.js"
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- name: "Install dependencies"
run: npm install --no-save
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: "Set up Node.js"
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: "Install dependencies"
run: npm install --no-save
- name: "Run eslint - linting"
Expand All @@ -46,7 +46,7 @@ jobs:
touch RELEASE_DETAILS.md
echo "$RELEASE_DETAILS" > RELEASE_DETAILS.md
- name: "Upload to Draft Release"
uses: ncipollo/release-action@v1
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
with:
draft: true
name: "AWS Advanced NodeJS Wrapper - v${{ env.RELEASE_VERSION }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remove-old-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Remove Old Artifacts
uses: c-hive/gha-remove-artifacts@v1
uses: c-hive/gha-remove-artifacts@44fc7acaf1b3d0987da0e8d4707a989d80e9554b # v1
with:
age: "1 week"
skip-tags: true
14 changes: 7 additions & 7 deletions .github/workflows/run-autoscaling-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
dbEngine: [ "mysql", "postgres" ]
steps:
- name: Clone repository
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 50
- name: "Set up JDK 8"
uses: actions/setup-java@v3
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "corretto"
java-version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: nodejs_autoscaling_tests
Expand All @@ -56,7 +56,7 @@ jobs:
- name: "Get Github Action IP"
if: always()
id: ip
uses: haythem/public-ip@v1.3
uses: haythem/public-ip@bdddd92c198b0955f0b494a8ebeac529754262ff # v1.3
- name: "Remove Github Action IP"
if: always()
run: |
Expand All @@ -68,7 +68,7 @@ jobs:
2>&1 > /dev/null;
- name: Archive results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: autoscaling-report
path: ./tests/integration/container/reports
Expand Down
4 changes: 2 additions & 2 deletions common/lib/connection_plugin_chain_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { StaleDnsPluginFactory } from "./plugins/stale_dns/stale_dns_plugin_fact
import { FederatedAuthPluginFactory } from "./plugins/federated_auth/federated_auth_plugin_factory";
import { ReadWriteSplittingPluginFactory } from "./plugins/read_write_splitting/read_write_splitting_plugin_factory";
import { OktaAuthPluginFactory } from "./plugins/federated_auth/okta_auth_plugin_factory";
import { HostMonitoringPluginFactory } from "./plugins/efm/host_monitoring_plugin_factory";
import { HostMonitoringPluginFactory } from "./plugins/efm/v1/host_monitoring_plugin_factory";
import { AuroraInitialConnectionStrategyFactory } from "./plugins/aurora_initial_connection_strategy_plugin_factory";
import { AuroraConnectionTrackerPluginFactory } from "./plugins/connection_tracker/aurora_connection_tracker_plugin_factory";
import { ConnectionProviderManager } from "./connection_provider_manager";
Expand All @@ -41,7 +41,7 @@ import { LimitlessConnectionPluginFactory } from "./plugins/limitless/limitless_
import { FastestResponseStrategyPluginFactory } from "./plugins/strategy/fastest_response/fastest_respose_strategy_plugin_factory";
import { CustomEndpointPluginFactory } from "./plugins/custom_endpoint/custom_endpoint_plugin_factory";
import { ConfigurationProfile } from "./profile/configuration_profile";
import { HostMonitoring2PluginFactory } from "./plugins/efm2/host_monitoring2_plugin_factory";
import { HostMonitoring2PluginFactory } from "./plugins/efm/v2/host_monitoring2_plugin_factory";
import { BlueGreenPluginFactory } from "./plugins/bluegreen/blue_green_plugin_factory";
import { GlobalDbFailoverPluginFactory } from "./plugins/gdb_failover/global_db_failover_plugin_factory";
import { FullServicesContainer } from "./utils/full_services_container";
Expand Down
39 changes: 2 additions & 37 deletions common/lib/host_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ export class HostInfo {
public static readonly NO_PORT: number = -1;
public static readonly DEFAULT_WEIGHT: number = 100;

readonly host: string;
readonly host: string; // full domain name
readonly port: number;
role: HostRole;
readonly weight: number; // Greater or equal 0. Lesser the weight, the healthier host.
readonly lastUpdateTime: number;
availability: HostAvailability;
aliases: Set<string> = new Set<string>();
allAliases: Set<string> = new Set<string>();
hostId: string;
hostId: string; // id; could be a host name, host domain name, or a unique string
hostAvailabilityStrategy: HostAvailabilityStrategy;

constructor(
Expand All @@ -57,46 +55,13 @@ export class HostInfo {
this.weight = weight;
this.lastUpdateTime = lastUpdateTime;
this.hostAvailabilityStrategy = hostAvailabilityStrategy;
this.allAliases.add(this.asAlias).add(this.host);
this.hostId = hostId;
}

isPortSpecified(): boolean {
return this.port != HostInfo.NO_PORT;
}

addAlias(...alias: string[]) {
if (!alias || alias.length < 1) {
return;
}

alias.forEach((x) => {
this.aliases.add(x);
this.allAliases.add(x);
});
}

removeAlias(aliases: string[]) {
if (!aliases || aliases.length < 1) {
return;
}

aliases.forEach((x) => {
this.aliases.delete(x);
this.allAliases.delete(x);
});
}

resetAliases() {
this.aliases.clear();
this.allAliases.clear();
this.allAliases.add(this.asAlias);
}

get asAlias() {
return this.isPortSpecified() ? `${this.host}:${this.port}` : this.host;
}

get url() {
let url = this.hostAndPort;
if (!url.endsWith("/")) {
Expand Down
17 changes: 2 additions & 15 deletions common/lib/host_list_provider/rds_host_list_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,30 +185,17 @@ export class RdsHostListProvider implements DynamicHostListProvider {
}

let topology = await this.refresh();
let isForcedRefresh = false;

if (!topology) {
topology = await this.forceRefresh();
isForcedRefresh = true;
}

if (!topology) {
return null;
}

const instanceId = instanceIds[0];
const instanceName = instanceIds[1];
let matches = topology.filter((host) => host.hostId === instanceName);
const foundHost = matches.length === 0 ? null : matches[0];

if (!foundHost && !isForcedRefresh) {
topology = await this.forceRefresh();
if (!topology) {
return null;
}
}

matches = topology.filter((host) => host.hostId === instanceName);
return matches.length === 0 ? null : matches[0];
return topology.find((host) => instanceId === host.hostId || instanceName === host.host) ?? null;
}

async refresh(): Promise<HostInfo[]> {
Expand Down
1 change: 0 additions & 1 deletion common/lib/host_list_provider/topology_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export abstract class TopologyUtils {
.withLastUpdateTime(lastUpdateTime)
.withHostId(finalInstanceId)
.build();
host.addAlias(finalEndpoint);
return host;
}

Expand Down
Loading