Skip to content

Commit

Permalink
Merge branch 'v5.4' of github.com:ravendb/ravendb into v6.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	docker/common.ps1
#	docker/ravendb-ubuntu/Dockerfile.arm32v7
#	docker/ravendb-ubuntu/Dockerfile.arm64v8
#	docker/ravendb-ubuntu/Dockerfile.x64
#	src/Raven.Client/Documents/Commands/UpdateSubscriptionCommand.cs
#	src/Raven.Client/Documents/Subscriptions/SubscriptionCriteria.cs
#	src/Raven.Server/Documents/DocumentDatabase.cs
#	src/Raven.Server/Documents/ExecuteRateLimitedOperations.cs
#	src/Raven.Server/Documents/Expiration/ExpirationStorage.cs
#	src/Raven.Server/Documents/Handlers/BatchHandler.cs
#	src/Raven.Server/Documents/Handlers/SubscriptionsHandler.cs
#	src/Raven.Server/Documents/Queries/AbstractQueryRunner.cs
#	test/FastTests/Client/Subscriptions/SubscriptionsBasic.cs
#	test/SlowTests/Server/Documents/Expiration/ExpirationTests.cs
  • Loading branch information
arekpalinski committed May 27, 2024
2 parents 1963e09 + e6d5c7f commit b9ff761
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 21 deletions.
9 changes: 8 additions & 1 deletion docker/ravendb-nanoserver/Dockerfile.1809
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

FROM mcr.microsoft.com/powershell:lts-nanoserver-1809

ENV RAVEN_ARGS='' RAVEN_SETTINGS='' RAVEN_Setup_Mode='Initial' RAVEN_DataDir='RavenData' RAVEN_ServerUrl_Tcp='38888' RAVEN_AUTO_INSTALL_CA='true' RAVEN_IN_DOCKER='true'
ENV RAVEN_ARGS='' `
RAVEN_SETTINGS='' `
RAVEN_Setup_Mode='Initial' `
RAVEN_DataDir='RavenData' `
RAVEN_ServerUrl_Tcp='38888' `
RAVEN_AUTO_INSTALL_CA='true' `
RAVEN_IN_DOCKER='true' `
RAVEN_Security_UnsecuredAccessAllowed='PrivateNetwork'

EXPOSE 8080 38888 161

Expand Down
9 changes: 8 additions & 1 deletion docker/ravendb-nanoserver/Dockerfile.ltsc2022
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

FROM mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022

ENV RAVEN_ARGS='' RAVEN_SETTINGS='' RAVEN_Setup_Mode='Initial' RAVEN_DataDir='RavenData' RAVEN_ServerUrl_Tcp='38888' RAVEN_AUTO_INSTALL_CA='true' RAVEN_IN_DOCKER='true'
ENV RAVEN_ARGS='' `
RAVEN_SETTINGS='' `
RAVEN_Setup_Mode='Initial' `
RAVEN_DataDir='RavenData' `
RAVEN_ServerUrl_Tcp='38888' `
RAVEN_AUTO_INSTALL_CA='true' `
RAVEN_IN_DOCKER='true' `
RAVEN_Security_UnsecuredAccessAllowed='PrivateNetwork'

EXPOSE 8080 38888 161

Expand Down
3 changes: 2 additions & 1 deletion docker/ravendb-ubuntu/Dockerfile.arm32v7
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV RAVEN_ARGS='' \
RAVEN_Logs_Path='/var/log/ravendb/logs' \
RAVEN_Security_AuditLog_FolderPath='/var/log/ravendb/audit' \
RAVEN_Security_MasterKey_Path='/etc/ravendb/security/master.key' \
RAVEN_Setup_Certificate_Path='/etc/ravendb/security/server.pfx'
RAVEN_Setup_Certificate_Path='/etc/ravendb/security/server.pfx' \
RAVEN_Security_UnsecuredAccessAllowed='PrivateNetwork'

EXPOSE 8080 38888 161

Expand Down
3 changes: 2 additions & 1 deletion docker/ravendb-ubuntu/Dockerfile.arm64v8
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV RAVEN_ARGS='' \
RAVEN_Logs_Path='/var/log/ravendb/logs' \
RAVEN_Security_AuditLog_FolderPath='/var/log/ravendb/audit' \
RAVEN_Security_MasterKey_Path='/etc/ravendb/security/master.key' \
RAVEN_Setup_Certificate_Path='/etc/ravendb/security/server.pfx'
RAVEN_Setup_Certificate_Path='/etc/ravendb/security/server.pfx' \
RAVEN_Security_UnsecuredAccessAllowed='PrivateNetwork'

EXPOSE 8080 38888 161

Expand Down
3 changes: 2 additions & 1 deletion docker/ravendb-ubuntu/Dockerfile.x64
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV RAVEN_ARGS='' \
RAVEN_Logs_Path='/var/log/ravendb/logs' \
RAVEN_Security_AuditLog_FolderPath='/var/log/ravendb/audit' \
RAVEN_Security_MasterKey_Path='/etc/ravendb/security/master.key' \
RAVEN_Setup_Certificate_Path='/etc/ravendb/security/server.pfx'
RAVEN_Setup_Certificate_Path='/etc/ravendb/security/server.pfx' \
RAVEN_Security_UnsecuredAccessAllowed='PrivateNetwork'

EXPOSE 8080 38888 161

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public async Task GetClusterWideInfoPackage()
using (ctx.OpenReadTransaction())
topology = ServerStore.GetClusterTopology(ctx);

var timeoutInSecPerNode = GetIntValueQueryString("timeoutInSecPerNode", false) ?? 60;
var timeoutInSecPerNode = GetIntValueQueryString("timeoutInSecPerNode", false) ?? 60 * 60;
var clusterOperationToken = CreateHttpRequestBoundOperationToken();
var type = GetDebugInfoPackageContentType();
var databases = GetStringValuesQueryString("database", required: false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected override AbstractClusterTransactionRequestProcessor<DatabaseRequestHan
[DoesNotReturn]
private static void ThrowTimeoutException(List<WaitForIndexItem> indexesToWait, int i, Stopwatch sp, QueryOperationContext context, long cutoffEtag)
{
var staleIndexesCount = 0;
var staleIndexes = new List<string>();
var erroredIndexes = new List<string>();
var pausedIndexes = new List<string>();

Expand All @@ -183,11 +183,13 @@ private static void ThrowTimeoutException(List<WaitForIndexItem> indexesToWait,
}

if (index.IsStale(context, cutoffEtag))
staleIndexesCount++;
{
staleIndexes.Add(index.Name);
}
}

var errorMessage = $"After waiting for {sp.Elapsed}, could not verify that all indexes has caught up with the changes as of etag: {cutoffEtag:#,#;;0}. " +
$"Total relevant indexes: {indexesToWait.Count}, total stale indexes: {staleIndexesCount}";
$"Total relevant indexes: {indexesToWait.Count}, total stale indexes: {staleIndexes.Count} ({string.Join(", ", staleIndexes)})";

if (erroredIndexes.Count > 0)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
{
"Security.UnsecuredAccessAllowed": "PrivateNetwork"
}
{}

Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"Security.UnsecuredAccessAllowed": "PrivateNetwork"
}
{}
2 changes: 1 addition & 1 deletion test/SlowTests/Issues/RavenDB-17157.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void OnSessionCreated_WaitForIndexesAfterSaveChanges_DisableIndexTest()
session.Store(new User { Name = "Bar" });
var exception = Assert.Throws<RavenTimeoutException>(() => session.SaveChanges());

Assert.Contains("total stale indexes: 1", exception.Message);
Assert.Contains($"total stale indexes: 1 ({indexName})", exception.Message);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/SlowTests/Issues/RavenDB-18373.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public async Task Waiting_For_Index_Doesnt_Work_For_ClusterWideTransaction(Trans
{
using var store = GetDocumentStore();

await new Simple_Map_Index().ExecuteAsync(store);
var index = new Simple_Map_Index();
await index.ExecuteAsync(store);
await store.Maintenance.SendAsync(new StopIndexingOperation());

using (var session = store.OpenAsyncSession(new SessionOptions {
Expand All @@ -52,7 +53,8 @@ public async Task Waiting_For_Index_Doesnt_Work_For_ClusterWideTransaction(Trans
session.Advanced.WaitForIndexesAfterSaveChanges(TimeSpan.FromSeconds(3));

await session.StoreAsync(new TestObj(), "testObjs/0");
await Assert.ThrowsAsync<RavenTimeoutException>(async () => await session.SaveChangesAsync());
var error = await Assert.ThrowsAsync<RavenTimeoutException>(async () => await session.SaveChangesAsync());
Assert.Contains($"total stale indexes: 1 ({index.IndexName})", error.Message);
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/SlowTests/Issues/RavenDB-18688.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ await session.StoreAsync(
session.Advanced.WaitForIndexesAfterSaveChanges(timeout: TimeSpan.FromSeconds(5));
var error = await Assert.ThrowsAsync<RavenTimeoutException>(async () => await session.SaveChangesAsync());
Assert.StartsWith("Raven.Client.Exceptions.RavenTimeoutException", error.Message);
Assert.Contains($"Total relevant indexes: 1, total stale indexes: 1, total errored indexes: 1 ({index.IndexName})", error.Message);
Assert.Contains($"Total relevant indexes: 1, total stale indexes: 1 ({index.IndexName}), total errored indexes: 1 ({index.IndexName})", error.Message);
Assert.DoesNotContain("total paused indexes", error.Message);
}

Expand All @@ -104,7 +104,7 @@ await session.StoreAsync(
session.Advanced.WaitForIndexesAfterSaveChanges(timeout: TimeSpan.FromSeconds(5), indexes: new[] { index.IndexName });
var error = await Assert.ThrowsAsync<RavenTimeoutException>(async () => await session.SaveChangesAsync());
Assert.StartsWith("Raven.Client.Exceptions.RavenTimeoutException", error.Message);
Assert.Contains($"Total relevant indexes: 1, total stale indexes: 1, total errored indexes: 1 ({index.IndexName})", error.Message);
Assert.Contains($"Total relevant indexes: 1, total stale indexes: 1 ({index.IndexName}), total errored indexes: 1 ({index.IndexName})", error.Message);
Assert.DoesNotContain("total paused indexes", error.Message);
}

Expand All @@ -120,7 +120,7 @@ await session.StoreAsync(
session.Advanced.WaitForIndexesAfterSaveChanges(timeout: TimeSpan.FromSeconds(5));
var error = await Assert.ThrowsAsync<RavenTimeoutException>(async () => await session.SaveChangesAsync());
Assert.StartsWith("Raven.Client.Exceptions.RavenTimeoutException", error.Message);
Assert.Contains($"Total relevant indexes: 2, total stale indexes: 1, total errored indexes: 1 ({index.IndexName})", error.Message);
Assert.Contains($"Total relevant indexes: 2, total stale indexes: 1 ({index.IndexName}), total errored indexes: 1 ({index.IndexName})", error.Message);
Assert.DoesNotContain("total paused indexes", error.Message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3863,6 +3863,13 @@ public async Task can_snapshot_and_restore_with_subscription(BackupType backupTy
await mre.WaitAsync(_reasonableWaitTime);

var subscriptionsConfig = await store.Subscriptions.GetSubscriptionsAsync(0, 10);

await WaitForValueAsync(async () =>
{
subscriptionsConfig = await store.Subscriptions.GetSubscriptionsAsync(0, 10);
return subscriptionsConfig[0].ChangeVectorForNextBatchStartingPoint;
}, lastCv);

Assert.Equal(1, subscriptionsConfig.Count);
Assert.Equal(lastCv, subscriptionsConfig[0].ChangeVectorForNextBatchStartingPoint);
var snapshotCv = lastCv;
Expand All @@ -3885,6 +3892,7 @@ public async Task can_snapshot_and_restore_with_subscription(BackupType backupTy
}.Initialize();

subscriptionsConfig = await destination.Subscriptions.GetSubscriptionsAsync(0, 10);

Assert.Equal(1, subscriptionsConfig.Count);
Assert.Equal(snapshotCv.Split("-")[0], subscriptionsConfig[0].ChangeVectorForNextBatchStartingPoint.Split("-")[0]);
}
Expand Down

0 comments on commit b9ff761

Please sign in to comment.