-
Notifications
You must be signed in to change notification settings - Fork 415
RI-6658: fallback to HELLO command when INFO is disabled via ACL #4377
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
Changes from 11 commits
937b69a
3dcffeb
2ae9be0
c5bb1e2
5f4230f
819e2a4
e1c4e1b
7032266
9e842b9
af075db
021f24b
aa17555
6ee35d6
62dbbe7
cc96937
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| export enum TransformGroup { | ||
| Secure = 'security', | ||
| } | ||
|
|
||
| export const UNKNOWN_REDIS_INFO = { | ||
| server: { | ||
| redis_version: 'unknown', | ||
| redis_mode: 'standalone', | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ import { get } from 'lodash'; | |
| import { | ||
| BadRequestException, HttpException, Injectable, Logger, | ||
| } from '@nestjs/common'; | ||
| import { catchAclError, convertRedisInfoReplyToObject } from 'src/utils'; | ||
| import { catchAclError } from 'src/utils'; | ||
| import { IClusterInfo } from 'src/modules/cluster-monitor/strategies/cluster.info.interface'; | ||
| import { ClusterNodesInfoStrategy } from 'src/modules/cluster-monitor/strategies/cluster-nodes.info.strategy'; | ||
| import { ClusterShardsInfoStrategy } from 'src/modules/cluster-monitor/strategies/cluster-shards.info.strategy'; | ||
|
|
@@ -41,10 +41,7 @@ export class ClusterMonitorService { | |
| return Promise.reject(new BadRequestException('Current database is not in a cluster mode')); | ||
| } | ||
|
|
||
| const info = convertRedisInfoReplyToObject(await client.sendCommand( | ||
| ['info', 'server'], | ||
| { replyEncoding: 'utf8' }, | ||
| ) as string); | ||
| const info = await client.getInfo(true, 'server'); | ||
|
||
|
|
||
| const strategy = this.getClusterInfoStrategy(get(info, 'server.redis_version')); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ import { | |
| calculateRedisHitRatio, | ||
| catchAclError, | ||
| convertIntToSemanticVersion, | ||
| convertRedisInfoReplyToObject, | ||
| } from 'src/utils'; | ||
| import { AdditionalRedisModule } from 'src/modules/database/models/additional.redis.module'; | ||
| import { REDIS_MODULES_COMMANDS, SUPPORTED_REDIS_MODULES } from 'src/constants'; | ||
|
|
@@ -76,10 +75,7 @@ export class DatabaseInfoProvider { | |
| */ | ||
| public async determineDatabaseServer(client: RedisClient): Promise<string> { | ||
| try { | ||
| const reply = convertRedisInfoReplyToObject(await client.call( | ||
| ['info', 'server'], | ||
| { replyEncoding: 'utf8' }, | ||
| ) as string); | ||
| const reply = await client.getInfo(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like here |
||
| return reply['server']?.redis_version; | ||
| } catch (e) { | ||
| // continue regardless of error | ||
|
|
@@ -135,10 +131,7 @@ export class DatabaseInfoProvider { | |
| client: RedisClient, | ||
| ): Promise<RedisDatabaseInfoResponse> { | ||
| try { | ||
| const info = convertRedisInfoReplyToObject(await client.sendCommand( | ||
| ['info'], | ||
| { replyEncoding: 'utf8' }, | ||
| ) as string); | ||
| const info = await client.getInfo(); | ||
| const serverInfo = info['server']; | ||
| const memoryInfo = info['memory']; | ||
| const keyspaceInfo = info['keyspace']; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.