Skip to content

Commit 742d2d0

Browse files
authored
Revert "Backport fixes to v5 (#4057)"
This reverts commit 8ea38bb.
1 parent 38ba643 commit 742d2d0

File tree

20 files changed

+71
-311
lines changed

20 files changed

+71
-311
lines changed

src/ServiceControl.Audit.Persistence.RavenDB/DatabaseConfiguration.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ public DatabaseConfiguration(string name,
1111
TimeSpan auditRetentionPeriod,
1212
int maxBodySizeToStore,
1313
int minimumStorageLeftRequiredForIngestion,
14-
ServerConfiguration serverConfiguration,
15-
TimeSpan bulkInsertCommitTimeout)
14+
ServerConfiguration serverConfiguration)
1615
{
1716
Name = name;
1817
ExpirationProcessTimerInSeconds = expirationProcessTimerInSeconds;
1918
EnableFullTextSearch = enableFullTextSearch;
2019
AuditRetentionPeriod = auditRetentionPeriod;
2120
MaxBodySizeToStore = maxBodySizeToStore;
2221
ServerConfiguration = serverConfiguration;
23-
BulkInsertCommitTimeout = bulkInsertCommitTimeout;
2422
MinimumStorageLeftRequiredForIngestion = minimumStorageLeftRequiredForIngestion;
2523
}
2624

@@ -39,7 +37,5 @@ public DatabaseConfiguration(string name,
3937
public int MaxBodySizeToStore { get; }
4038

4139
public int MinimumStorageLeftRequiredForIngestion { get; internal set; } //Setting for ATT only
42-
43-
public TimeSpan BulkInsertCommitTimeout { get; }
4440
}
4541
}

src/ServiceControl.Audit.Persistence.RavenDB/RavenLicense.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"Id": "64c6a174-3f3a-4e7d-ac5d-b3eedd801460",
33
"Name": "ParticularNservicebus (Israel)",
44
"Keys": [
5-
"mGE1ppvgfJjJZXnMUHFXQXJuL",
6-
"sQ1trVf0DZlVNhFSjclHNQ36p",
7-
"0a9ZWIaCiqu8Mh4CDVd4koc2X",
8-
"2Y18vLYbTm5JH4J91IZJhq3bP",
9-
"/bzD806qeBpRcDCLt82ON0+RO",
10-
"eXiLDs/DTOBU9sPsNZEPzUX+C",
11-
"uMA5nm6QaaB85GEpFuahhAAyU",
12-
"GKEkFCisMLQ4vMAcREjM0NRYX",
13-
"GhufAh8AnwIgAJ8CIwCfAiQgn",
14-
"wIlIJ8CJiCfAicgnwIoIJ8CKS",
15-
"CfAiognwIrIJ8CLACfAi0AnwI",
16-
"uIJ8CLwCfAjAggQM2LjBDMEQG",
17-
"ODk8PT6fAiEgYoRa"
5+
"NKhWkUrAnwvE+M6VmSxK7J6am",
6+
"D2JME/+XVMQq9xh18W4lClw+a",
7+
"FDWF3ZqgA89/tIgwUyc8BZ09f",
8+
"wSsdi8WzL/w01TOB00HuGQE4r",
9+
"jAkg7BKr7LWIRfbg02KLhiU4M",
10+
"Y1FQx8IA4BOBK0XP+X+aaWE48",
11+
"fLmwuqGsSc0kg0rzFdYs9AAyU",
12+
"GKEkFCisMLQ4vMAcREjM0NRYX",
13+
"GhufAh8AnwIgAJ8CIwCfAiQgn",
14+
"wIlIJ8CJiCfAicgnwIoIJ8CKS",
15+
"CfAiognwIrIJ8CLACfAi0AnwI",
16+
"uIJ8CLwCfAjAggQM2LjBDMEQG",
17+
"ODk8PT6fAiEgYoFY"
1818
]
1919
}

src/ServiceControl.Audit.Persistence.RavenDB/RavenPersistenceConfiguration.cs

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public class RavenPersistenceConfiguration : IPersistenceConfiguration
1414
public const string LogPathKey = "LogPath";
1515
public const string RavenDbLogLevelKey = "RavenDBLogLevel";
1616
public const string MinimumStorageLeftRequiredForIngestionKey = "MinimumStorageLeftRequiredForIngestion";
17-
public const string BulkInsertCommitTimeoutInSecondsKey = "BulkInsertCommitTimeoutInSeconds";
1817

1918
public IEnumerable<string> ConfigurationKeys => new[]{
2019
DatabaseNameKey,
@@ -24,8 +23,7 @@ public class RavenPersistenceConfiguration : IPersistenceConfiguration
2423
ExpirationProcessTimerInSecondsKey,
2524
LogPathKey,
2625
RavenDbLogLevelKey,
27-
MinimumStorageLeftRequiredForIngestionKey,
28-
BulkInsertCommitTimeoutInSecondsKey
26+
MinimumStorageLeftRequiredForIngestionKey
2927
};
3028

3129
public string Name => "RavenDB";
@@ -100,17 +98,14 @@ internal static DatabaseConfiguration GetDatabaseConfiguration(PersistenceSettin
10098

10199
var expirationProcessTimerInSeconds = GetExpirationProcessTimerInSeconds(settings);
102100

103-
var bulkInsertTimeout = TimeSpan.FromSeconds(GetBulkInsertCommitTimeout(settings));
104-
105101
return new DatabaseConfiguration(
106102
databaseName,
107103
expirationProcessTimerInSeconds,
108104
settings.EnableFullTextSearchOnBodies,
109105
settings.AuditRetentionPeriod,
110106
settings.MaxBodySizeToStore,
111107
minimumStorageLeftRequiredForIngestion,
112-
serverConfiguration,
113-
bulkInsertTimeout);
108+
serverConfiguration);
114109
}
115110

116111
static int GetExpirationProcessTimerInSeconds(PersistenceSettings settings)
@@ -137,33 +132,8 @@ static int GetExpirationProcessTimerInSeconds(PersistenceSettings settings)
137132
return expirationProcessTimerInSeconds;
138133
}
139134

140-
static int GetBulkInsertCommitTimeout(PersistenceSettings settings)
141-
{
142-
var bulkInsertCommitTimeoutInSeconds = BulkInsertCommitTimeoutInSecondsDefault;
143-
144-
if (settings.PersisterSpecificSettings.TryGetValue(BulkInsertCommitTimeoutInSecondsKey, out var bulkInsertCommitTimeoutString))
145-
{
146-
bulkInsertCommitTimeoutInSeconds = int.Parse(bulkInsertCommitTimeoutString);
147-
}
148-
149-
if (bulkInsertCommitTimeoutInSeconds < 0)
150-
{
151-
Logger.Error($"BulkInsertCommitTimeout cannot be negative. Defaulting to {BulkInsertCommitTimeoutInSecondsDefault}");
152-
return BulkInsertCommitTimeoutInSecondsDefault;
153-
}
154-
155-
if (bulkInsertCommitTimeoutInSeconds > TimeSpan.FromHours(1).TotalSeconds)
156-
{
157-
Logger.Error($"BulkInsertCommitTimeout cannot be larger than {TimeSpan.FromHours(1).TotalSeconds}. Defaulting to {BulkInsertCommitTimeoutInSecondsDefault}");
158-
return BulkInsertCommitTimeoutInSecondsDefault;
159-
}
160-
161-
return bulkInsertCommitTimeoutInSeconds;
162-
}
163-
164135
static readonly ILog Logger = LogManager.GetLogger(typeof(RavenPersistenceConfiguration));
165136

166137
const int ExpirationProcessTimerInSecondsDefault = 600;
167-
const int BulkInsertCommitTimeoutInSecondsDefault = 60;
168138
}
169139
}

src/ServiceControl.Audit.Persistence.RavenDB/UnitOfWork/RavenAuditUnitOfWorkFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public RavenAuditIngestionUnitOfWorkFactory(IRavenDocumentStoreProvider document
2020

2121
public IAuditIngestionUnitOfWork StartNew(int batchSize)
2222
{
23-
var timedCancellationSource = new CancellationTokenSource(databaseConfiguration.BulkInsertCommitTimeout);
23+
var timedCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(1));
2424
var bulkInsert = documentStoreProvider.GetDocumentStore()
2525
.BulkInsert(new BulkInsertOptions { SkipOverwriteIfUnchanged = true, }, timedCancellationSource.Token);
2626

src/ServiceControl.Audit.Persistence.Tests.RavenDB/SharedEmbeddedServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static async Task<EmbeddedDatabase> GetInstance(CancellationToken cancell
2727
var logsMode = "Operations";
2828
var serverUrl = $"http://localhost:{PortUtility.FindAvailablePort(33334)}";
2929

30-
embeddedDatabase = EmbeddedDatabase.Start(new DatabaseConfiguration("audit", 60, true, TimeSpan.FromMinutes(5), 120000, 5, new ServerConfiguration(dbPath, serverUrl, logPath, logsMode), TimeSpan.FromSeconds(60)));
30+
embeddedDatabase = EmbeddedDatabase.Start(new DatabaseConfiguration("audit", 60, true, TimeSpan.FromMinutes(5), 120000, 5, new ServerConfiguration(dbPath, serverUrl, logPath, logsMode)));
3131

3232
//make sure that the database is up
3333
while (true)

src/ServiceControl.Config.Tests/AddInstance/AddErrorInstance/PathNotifyPropertyChanges.cs

Lines changed: 0 additions & 129 deletions
This file was deleted.

src/ServiceControl.Config.Tests/FilePathExtensionsTests.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/ServiceControl.Config.Tests/ServiceControlAddScreenLoadedTests.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace ServiceControl.Config.Tests
22
{
3-
using System;
43
using System.ComponentModel;
54
using NUnit.Framework;
65
using ServiceControlInstaller.Engine.Configuration.ServiceControl;
@@ -9,9 +8,6 @@
98

109
class AddErrorInstanceScreenLoadedTests
1110
{
12-
static readonly string programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
13-
static readonly string programX86Path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
14-
1511
[Test]
1612
public void Error_and_Audit_Instances_are_selected_for_install()
1713
{
@@ -152,11 +148,11 @@ public void Destination_path_is_null()
152148

153149
var errorInfo = (INotifyDataErrorInfo)viewModel;
154150

155-
Assert.That(viewModel.ErrorDestinationPath, Is.EqualTo($@"{programX86Path}\Particular Software\Particular.ServiceControl"));
151+
Assert.IsNull(viewModel.ErrorDestinationPath);
156152

157153
Assert.IsEmpty(errorInfo.GetErrors(nameof(viewModel.ErrorDestinationPath)));
158154

159-
Assert.That(viewModel.AuditDestinationPath, Is.EqualTo($@"{programX86Path}\Particular Software\Particular.ServiceControl.Audit"));
155+
Assert.IsNull(viewModel.AuditDestinationPath);
160156

161157
Assert.IsEmpty(errorInfo.GetErrors(nameof(viewModel.AuditDestinationPath)));
162158
}
@@ -168,11 +164,11 @@ public void Log_path_is_null()
168164

169165
var errorInfo = (INotifyDataErrorInfo)viewModel;
170166

171-
Assert.That(viewModel.ErrorLogPath, Is.EqualTo($@"{programDataPath}\Particular\ServiceControl\Particular.ServiceControl\Logs"));
167+
Assert.IsNull(viewModel.ErrorLogPath);
172168

173169
Assert.IsEmpty(errorInfo.GetErrors(nameof(viewModel.ErrorLogPath)));
174170

175-
Assert.That(viewModel.AuditLogPath, Is.EqualTo($@"{programDataPath}\Particular\ServiceControl\Particular.ServiceControl.Audit\Logs"));
171+
Assert.IsNull(viewModel.AuditLogPath);
176172

177173
Assert.IsEmpty(errorInfo.GetErrors(nameof(viewModel.AuditLogPath)));
178174
}
@@ -185,11 +181,11 @@ public void Database_path_is_null()
185181

186182
var errorInfo = (INotifyDataErrorInfo)viewModel;
187183

188-
Assert.That(viewModel.ErrorDatabasePath, Is.EqualTo($@"{programDataPath}\Particular\ServiceControl\Particular.ServiceControl\DB"));
184+
Assert.IsNull(viewModel.ErrorDatabasePath);
189185

190186
Assert.IsEmpty(errorInfo.GetErrors(nameof(viewModel.ErrorDatabasePath)));
191187

192-
Assert.That(viewModel.AuditDatabasePath, Is.EqualTo($@"{programDataPath}\Particular\ServiceControl\Particular.ServiceControl.Audit\DB"));
188+
Assert.IsNull(viewModel.AuditDatabasePath);
193189

194190
Assert.IsEmpty(errorInfo.GetErrors(nameof(viewModel.AuditDatabasePath)));
195191
}

src/ServiceControl.Config.Tests/Validation/AddAuditInstanceValidationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public void Convention_name_cannot_be_empty_when_instance_names_are_not_provided
3030

3131
var notifyErrorInfo = GetNotifyErrorInfo(viewModel);
3232

33-
Assert.That(instanceNamesProvided); // Provided because the convention auto-fills them on instantiation
33+
Assert.IsFalse(instanceNamesProvided);
3434

35-
Assert.IsEmpty(notifyErrorInfo.GetErrors(nameof(viewModel.ConventionName)));
35+
Assert.IsNotEmpty(notifyErrorInfo.GetErrors(nameof(viewModel.ConventionName)));
3636
}
3737

3838
[Test]

src/ServiceControl.Config.Tests/Validation/AddErrorInstanceValidationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public void Convention_name_cannot_be_empty_when_instance_names_are_not_provided
3030

3131
var notifyErrorInfo = GetNotifyErrorInfo(viewModel);
3232

33-
Assert.That(instanceNamesProvided); // Provided because the convention default auto-fills them on instantiation
33+
Assert.IsFalse(instanceNamesProvided);
3434

35-
Assert.IsEmpty(notifyErrorInfo.GetErrors(nameof(viewModel.ConventionName)));
35+
Assert.IsNotEmpty(notifyErrorInfo.GetErrors(nameof(viewModel.ConventionName)));
3636
}
3737

3838
[Test]

0 commit comments

Comments
 (0)