Skip to content

Commit 981e096

Browse files
authored
Rename server roles, master = SchedulingPublisher and replica = Subscriber (#10480)
1 parent dc8d338 commit 981e096

File tree

20 files changed

+52
-54
lines changed

20 files changed

+52
-54
lines changed

src/Umbraco.Core/Models/IServerRegistration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using Umbraco.Cms.Core.Models.Entities;
33
using Umbraco.Cms.Core.Sync;
44

@@ -19,9 +19,9 @@ public interface IServerRegistration : IServerAddress, IEntity, IRememberBeingDi
1919
bool IsActive { get; set; }
2020

2121
/// <summary>
22-
/// Gets or sets a value indicating whether the server is master.
22+
/// Gets or sets a value indicating whether the server is has the SchedulingPublisher role.
2323
/// </summary>
24-
bool IsMaster { get; set; }
24+
bool IsSchedulingPublisher { get; set; }
2525

2626
/// <summary>
2727
/// Gets the date and time the registration was created.

src/Umbraco.Core/Models/ServerRegistration.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Globalization;
33
using Umbraco.Cms.Core.Models.Entities;
44
using Umbraco.Extensions;
@@ -13,7 +13,7 @@ public class ServerRegistration : EntityBase, IServerRegistration
1313
private string _serverAddress;
1414
private string _serverIdentity;
1515
private bool _isActive;
16-
private bool _isMaster;
16+
private bool _isSchedulingPublisher;
1717

1818
/// <summary>
1919
/// Initializes a new instance of the <see cref="ServerRegistration"/> class.
@@ -31,7 +31,7 @@ public ServerRegistration()
3131
/// <param name="accessed">The date and time the registration was last accessed.</param>
3232
/// <param name="isActive">A value indicating whether the registration is active.</param>
3333
/// <param name="isMaster">A value indicating whether the registration is master.</param>
34-
public ServerRegistration(int id, string serverAddress, string serverIdentity, DateTime registered, DateTime accessed, bool isActive, bool isMaster)
34+
public ServerRegistration(int id, string serverAddress, string serverIdentity, DateTime registered, DateTime accessed, bool isActive, bool isSchedulingPublisher)
3535
{
3636
UpdateDate = accessed;
3737
CreateDate = registered;
@@ -40,7 +40,7 @@ public ServerRegistration(int id, string serverAddress, string serverIdentity, D
4040
ServerAddress = serverAddress;
4141
ServerIdentity = serverIdentity;
4242
IsActive = isActive;
43-
IsMaster = isMaster;
43+
IsSchedulingPublisher = isSchedulingPublisher;
4444
}
4545

4646
/// <summary>
@@ -86,12 +86,12 @@ public bool IsActive
8686
}
8787

8888
/// <summary>
89-
/// Gets or sets a value indicating whether the server is master.
89+
/// Gets or sets a value indicating whether the server has the SchedulingPublisher role
9090
/// </summary>
91-
public bool IsMaster
91+
public bool IsSchedulingPublisher
9292
{
93-
get => _isMaster;
94-
set => SetPropertyValueAndDetectChanges(value, ref _isMaster, nameof(IsMaster));
93+
get => _isSchedulingPublisher;
94+
set => SetPropertyValueAndDetectChanges(value, ref _isSchedulingPublisher, nameof(IsSchedulingPublisher));
9595
}
9696

9797
/// <summary>
@@ -118,7 +118,7 @@ public DateTime Accessed
118118
/// <returns></returns>
119119
public override string ToString()
120120
{
121-
return string.Format("{{\"{0}\", \"{1}\", {2}active, {3}master}}", ServerAddress, ServerIdentity, IsActive ? "" : "!", IsMaster ? "" : "!");
121+
return string.Format("{{\"{0}\", \"{1}\", {2}active, {3}master}}", ServerAddress, ServerIdentity, IsActive ? "" : "!", IsSchedulingPublisher ? "" : "!");
122122
}
123123
}
124124
}

src/Umbraco.Core/Sync/ElectedServerRoleAccessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Core.Sync
88
/// </summary>
99
/// <remarks>
1010
/// This is the default service which determines a server's role by using a master election process.
11-
/// The master election process doesn't occur until just after startup so this election process doesn't really affect the primary startup phase.
11+
/// The scheduling publisher election process doesn't occur until just after startup so this election process doesn't really affect the primary startup phase.
1212
/// </remarks>
1313
public sealed class ElectedServerRoleAccessor : IServerRoleAccessor
1414
{

src/Umbraco.Core/Sync/ServerRole.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Umbraco.Cms.Core.Sync
1+
namespace Umbraco.Cms.Core.Sync
22
{
33
/// <summary>
44
/// The role of a server in an application environment.
@@ -16,13 +16,13 @@ public enum ServerRole : byte
1616
Single = 1,
1717

1818
/// <summary>
19-
/// In a multi-servers environment, the server is a replica server.
19+
/// In a multi-servers environment, the server is a Subscriber server.
2020
/// </summary>
21-
Replica = 2,
21+
Subscriber = 2,
2222

2323
/// <summary>
24-
/// In a multi-servers environment, the server is the master server.
24+
/// In a multi-servers environment, the server is the Scheduling Publisher.
2525
/// </summary>
26-
Master = 3
26+
SchedulingPublisher = 3
2727
}
2828
}

src/Umbraco.Core/Sync/SingleServerRoleAccessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Sync
55
/// </summary>
66
/// <remarks>
77
/// The micro optimization is specifically to avoid a DB query just after the app starts up to determine the <see cref="ServerRole"/>
8-
/// which by default is done with master election by a database query. The master election process doesn't occur until just after startup
8+
/// which by default is done with scheduling publisher election by a database query. The master election process doesn't occur until just after startup
99
/// so this micro optimization doesn't really affect the primary startup phase.
1010
/// </remarks>
1111
public class SingleServerRoleAccessor : IServerRoleAccessor

src/Umbraco.Infrastructure/HostedServices/HealthCheckNotifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public override async Task PerformExecuteAsync(object state)
8989

9090
switch (_serverRegistrar.CurrentServerRole)
9191
{
92-
case ServerRole.Replica:
93-
_logger.LogDebug("Does not run on replica servers.");
92+
case ServerRole.Subscriber:
93+
_logger.LogDebug("Does not run on subscriber servers.");
9494
return;
9595
case ServerRole.Unknown:
9696
_logger.LogDebug("Does not run on servers with unknown role.");

src/Umbraco.Infrastructure/HostedServices/KeepAlive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public override async Task PerformExecuteAsync(object state)
6969
// Don't run on replicas nor unknown role servers
7070
switch (_serverRegistrar.CurrentServerRole)
7171
{
72-
case ServerRole.Replica:
73-
_logger.LogDebug("Does not run on replica servers.");
72+
case ServerRole.Subscriber:
73+
_logger.LogDebug("Does not run on subscriber servers.");
7474
return;
7575
case ServerRole.Unknown:
7676
_logger.LogDebug("Does not run on servers with unknown role.");

src/Umbraco.Infrastructure/HostedServices/LogScrubber.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public override Task PerformExecuteAsync(object state)
6363
{
6464
switch (_serverRegistrar.CurrentServerRole)
6565
{
66-
case ServerRole.Replica:
67-
_logger.LogDebug("Does not run on replica servers.");
66+
case ServerRole.Subscriber:
67+
_logger.LogDebug("Does not run on subscriber servers.");
6868
return Task.CompletedTask;
6969
case ServerRole.Unknown:
7070
_logger.LogDebug("Does not run on servers with unknown role.");

src/Umbraco.Infrastructure/HostedServices/ScheduledPublishing.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public override Task PerformExecuteAsync(object state)
6969

7070
switch (_serverRegistrar.CurrentServerRole)
7171
{
72-
case ServerRole.Replica:
73-
_logger.LogDebug("Does not run on replica servers.");
72+
case ServerRole.Subscriber:
73+
_logger.LogDebug("Does not run on subscriber servers.");
7474
return Task.CompletedTask;
7575
case ServerRole.Unknown:
7676
_logger.LogDebug("Does not run on servers with unknown role.");

src/Umbraco.Infrastructure/HostedServices/TempFileCleanup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ namespace Umbraco.Cms.Infrastructure.HostedServices
1414
/// Used to cleanup temporary file locations.
1515
/// </summary>
1616
/// <remarks>
17-
/// Will run on all servers - even though file upload should only be handled on the master, this will
18-
/// ensure that in the case it happes on replicas that they are cleaned up too.
17+
/// Will run on all servers - even though file upload should only be handled on the scheduling publisher, this will
18+
/// ensure that in the case it happens on subscribers that they are cleaned up too.
1919
/// </remarks>
2020
public class TempFileCleanup : RecurringHostedServiceBase
2121
{

0 commit comments

Comments
 (0)