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

If Vertica is not available, backup_server_node is not used. #114

Open
hulmgulm-at-work opened this issue Jan 31, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@hulmgulm-at-work
Copy link

To test the backup_server_node configuration, I created a configuration with an invalid host/port but a valid backup_server_node:

const connection = {
    backup_server_node: `vertica.example.com:5433`,
      host: 'invalidhost.example.com',
      port: 9999,
      user: 'user',
      password: 'password',
      database: 'database',
      log(message) {
        console.log(new Date(), message);
      }
}

Then I get a pool with this connection details:
const pool = new Pool(connection);
When I make a query on this pool

pool.connect().then(client => {
        const query = client.query(new Query('SELECT 1'), (result) => {
          console.log(result);
        });
});

the pool tries to make a connection to Vertica (which is not working, because at the given host/port is no Vertica) but does not switch to the backup. I see the following in the log:

2023-01-31T09:51:41.295Z checking client timeout
2023-01-31T09:51:41.296Z connecting new client
2023-01-31T09:53:51.132Z client failed to connect
2023-01-31T09:53:51.132Z pulse queue
2023-01-31T09:53:51.133Z no queued requests

Notice, that it takes the pool more than two minutes to notice, that it is not able to connect.
At the end, I get the following error: Error acquiring a connection from pool: connect ETIMEDOUT 10.168.179.57:9999 +0ms

How can I make vertica-nodejs to use backup_server_node in case of a connection failure?

@DMickens
Copy link
Collaborator

DMickens commented Feb 7, 2023

Beginning investigation into this issue

@sitingren sitingren added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants