1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

docs: maintanance mode impact (#3858)

This commit is contained in:
Mateusz Kwasniewski 2023-05-25 08:28:05 +02:00 committed by GitHub
parent ed4eff71fe
commit 78715e3374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,44 @@
import { SchedulerService } from './scheduler-service';
import MaintenanceService from './maintenance-service';
import { IUnleashStores } from '../types';
import SettingService from './setting-service';
import { createTestConfig } from '../../test/config/test-config';
test('Maintenance on should pause scheduler', async () => {
const config = createTestConfig();
const schedulerService = new SchedulerService(config.getLogger);
const maintenanceService = new MaintenanceService(
{} as IUnleashStores,
config,
{ insert() {} } as unknown as SettingService,
schedulerService,
);
await maintenanceService.toggleMaintenanceMode(
{ enabled: true },
'irrelevant user',
);
expect(schedulerService.getMode()).toBe('paused');
schedulerService.stop();
});
test('Maintenance off should resume scheduler', async () => {
const config = createTestConfig();
const schedulerService = new SchedulerService(config.getLogger);
schedulerService.pause();
const maintenanceService = new MaintenanceService(
{} as IUnleashStores,
config,
{ insert() {} } as unknown as SettingService,
schedulerService,
);
await maintenanceService.toggleMaintenanceMode(
{ enabled: false },
'irrelevant user',
);
expect(schedulerService.getMode()).toBe('active');
schedulerService.stop();
});

View File

@ -25,3 +25,18 @@ Maintenance mode is controlled from the "maintenance" section of the Unleash adm
When maintenance mode is enabled, a warning banner appears at the top of the Unleash dashboard, indicating that any changes made during this period will not be saved and may result in errors.
![Maintenance mode banner when maintenance mod is toggled on](/img/maintenance-banner.png)
## Maintenance mode and scheduled jobs
When maintenance mode is enabled all internal jobs performed by Unleash such as updating metrics and statistics are paused. When maintenance mode is toggled back to disabled later, all scheduled
jobs are resumed.
## Maintenance mode and read-only DB user
When maintenance mode is enabled most DB operations are suspended so you can use even read-only DB user. There's one exception though.
Unleash DB user role needs a DELETE and UPDATE permission on the unleash_session table.
```
GRANT DELETE ON unleash_session TO my_db_role;
GRANT UPDATE ON unleash_session TO my_db_role;
```