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

Dev/yisu/fmql diagnosis #870

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
17 changes: 17 additions & 0 deletions src/SfxWeb/cypress/e2e/cluster.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ context('Cluster page', () => {
})

describe("essentials", () => {
beforeEach(() => {
cy.intercept(apiUrl('/Partitions/00000000-0000-0000-0000-000000000001?*'),
{fixture: 'cluster-page/fm/notInQuorumLoss.json'}).as("getFMQuorumLossStatus")
})
it('load essentials', () => {
cy.visit('')

Expand Down Expand Up @@ -71,6 +75,19 @@ context('Cluster page', () => {

})


it('displays FM quorum loss warning when in quorum loss status', () => {
cy.visit('');
cy.wait('@getFMQuorumLossStatus')
cy.get('[data-cy="fmql-warning"]').should('not.exist');
cy.intercept(apiUrl('/Partitions/00000000-0000-0000-0000-000000000001?*'),
{fixture: 'cluster-page/fm/inQuorumLoss.json'}).as("getFMQuorumLossStatus")
cy.reload();
cy.wait('@getFMQuorumLossStatus')
cy.get('[data-cy="fmql-warning"]').should('exist').should('be.visible');
});


it('xss', () => {

addDefaultFixtures(xssPrefix);
Expand Down
4 changes: 4 additions & 0 deletions src/SfxWeb/cypress/fixtures/cluster-page/fm/inQuorumLoss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"ServiceKind": "Stateful",
"PartitionStatus": "InQuorumLoss"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"ServiceKind": "Stateful",
"PartitionStatus": "OK"
}
5 changes: 5 additions & 0 deletions src/SfxWeb/src/app/Common/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ export class TelemetryEventNames {
}


export class SystemServicePartitionId {
GeoffreyMa marked this conversation as resolved.
Show resolved Hide resolved
public static FailoverManagerId = '00000000-0000-0000-0000-000000000001';
}


export class RepairTaskMessages {
public static longExecutingMessage = "This update can prevent other updates from going through. Please reach out to the Azure Compute teams (“Compute Manager/Blackbird”) to figure out why the updates are not completing.";
public static longExecutingId = "longExecuting";
Expand Down
2 changes: 1 addition & 1 deletion src/SfxWeb/src/app/services/rest-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IRawCollection, IRawClusterManifest, IRawClusterHealth, IRawClusterUpgr
IRawApplication, IRawService, IRawCreateServiceDescription, IRawCreateServiceFromTemplateDescription, IRawUpdateServiceDescription, IRawServiceDescription,
IRawServiceHealth, IRawApplicationUpgradeProgress, IRawCreateComposeDeploymentDescription, IRawPartition, IRawPartitionHealth, IRawPartitionLoadInformation,
IRawReplicaOnPartition, IRawReplicaHealth, IRawImageStoreContent, IRawStoreFolderSize, IRawClusterVersion, IRawList, IRawAadMetadata, IRawStorage, IRawRepairTask,
IRawServiceNameInfo, IRawApplicationNameInfo, IRawBackupEntity, IRawInfrastructureJob, IRawInfraRepairTask, IRawRoleInstanceImpact } from '../Models/RawDataTypes';
IRawServiceNameInfo, IRawApplicationNameInfo, IRawBackupEntity, IRawInfrastructureJob, IRawInfraRepairTask, IRawRoleInstanceImpact} from '../Models/RawDataTypes';
import { mergeMap, map, catchError, finalize, skip } from 'rxjs/operators';
import { Application } from '../Models/DataModels/Application';
import { Service } from '../Models/DataModels/Service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ <h3 class="nested-header heading">Throttled Infrastructure Jobs</h3>
</app-collapse-container>
</div>

<div *ngIf="fmQuorumLossStatus" style="margin-bottom: 15px;" data-cy="fmql-warning">
<app-warning [description]="fmQuorumLossWarning" ></app-warning>
</div>

<div *ngIf="clusterUpgradeProgress.isInitialized && clusterUpgradeProgress.isUpgrading" class="detail-pane">
<div data-cy="upgradeDetails" class="essen-pane" style="flex: 1; min-width: 600px;">
<app-collapse-container sectionName="Upgrade Status" collapsed="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { HealthStateFilterFlags } from 'src/app/Models/HealthChunkRawDataTypes';
import { SystemApplication } from 'src/app/Models/DataModels/Application';
import { Observable, forkJoin, of } from 'rxjs';
import { IResponseMessageHandler } from 'src/app/Common/ResponseMessageHandlers';
import { SystemServicePartitionId } from 'src/app/Common/Constants';
import { BaseControllerDirective } from 'src/app/ViewModels/BaseController';
import { NodeCollection } from 'src/app/Models/DataModels/collections/NodeCollection';
import { ListSettings } from 'src/app/Models/ListSettings';
Expand All @@ -16,6 +17,8 @@ import { HealthUtils, HealthStatisticsEntityKind } from 'src/app/Utils/healthUti
import { RepairTaskCollection } from 'src/app/Models/DataModels/collections/RepairTaskCollection';
import { IEssentialListItem } from 'src/app/modules/charts/essential-health-tile/essential-health-tile.component';
import { InfrastructureCollection } from 'src/app/Models/DataModels/collections/infrastructureCollection';
import { RestClientService } from 'src/app/services/rest-client.service';
import { IRawPartition } from 'src/app/Models/RawDataTypes';

@Component({
selector: 'app-essentials',
Expand All @@ -41,12 +44,15 @@ export class EssentialsComponent extends BaseControllerDirective {
replicasDashboard: IDashboardViewModel;
upgradesDashboard: IDashboardViewModel;
upgradeAppsCount = 0;
fmQuorumLossStatus : boolean;
fmQuorumLossWarning : string;

essentialItems: IEssentialListItem[] = [];

constructor(public data: DataService,
public injector: Injector,
public settings: SettingsService,
public RestClient: RestClientService,
private routes: RoutesService) {
super(injector);
}
Expand All @@ -61,6 +67,8 @@ export class EssentialsComponent extends BaseControllerDirective {

this.infraCollection = this.data.infrastructureCollection;
this.infraSettings = this.settings.getNewOrExistingInfrastructureSettings();
this.fmQuorumLossWarning = `The Failover Manager service is in quorum loss state. Cluster may not be responding.
Service failover, automatic recovery will be blocked.Health/availability state of services/nodes may not be reflected.`
GeoffreyMa marked this conversation as resolved.
Show resolved Hide resolved
}

refresh(messageHandler?: IResponseMessageHandler): Observable<any> {
Expand Down Expand Up @@ -91,6 +99,12 @@ export class EssentialsComponent extends BaseControllerDirective {
this.nodes.refresh(messageHandler).pipe(map(() => {this.updateItemInEssentials(); })),
this.systemApp.refresh(messageHandler).pipe(catchError(err => of(null))),
this.clusterUpgradeProgress.refresh(messageHandler),
this.RestClient.getPartitionById(SystemServicePartitionId.FailoverManagerId, messageHandler).pipe(map((partition) => {
if (partition.PartitionStatus === 'InQuorumLoss') {
GeoffreyMa marked this conversation as resolved.
Show resolved Hide resolved
this.fmQuorumLossStatus = true;
}
})),

this.data.getClusterManifest().pipe(map((manifest) => {
if (manifest.isRepairManagerEnabled) {
return this.repairtaskCollection.refresh(messageHandler);
Expand Down
Loading