forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v5.4' of github.com:ravendb/ravendb into v6.0
- Loading branch information
Showing
7 changed files
with
149 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
test/SlowTests/Server/Documents/ETL/Queue/RavenDB_21530.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Collections.Generic; | ||
using Raven.Client.Documents.Operations.ETL.Queue; | ||
using Tests.Infrastructure; | ||
using Tests.Infrastructure.ConnectionString; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace SlowTests.Server.Documents.ETL.Queue; | ||
|
||
public class RavenDB_21530 : QueueEtlTestBase | ||
{ | ||
public RavenDB_21530(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[RavenFact(RavenTestCategory.Etl)] | ||
public void Can_check_kafka_connection_string_against_secured_channel() | ||
{ | ||
var c = new QueueEtlConfiguration | ||
{ | ||
BrokerType = QueueBrokerType.Kafka, | ||
Connection = new QueueConnectionString | ||
{ | ||
Name = "Test", | ||
BrokerType = QueueBrokerType.Kafka, | ||
KafkaConnectionSettings = new KafkaConnectionSettings() | ||
{ | ||
ConnectionOptions = new Dictionary<string, string>() | ||
{ | ||
{"security.protocol", "SASL_SSL"} | ||
}, | ||
BootstrapServers = "localhost:29290" | ||
} | ||
} | ||
}; | ||
|
||
Assert.True(c.UsingEncryptedCommunicationChannel()); | ||
} | ||
|
||
[RavenFact(RavenTestCategory.Etl)] | ||
public void Can_check_rabbitmq_connection_string_against_secured_channel() | ||
{ | ||
var c = new QueueEtlConfiguration | ||
{ | ||
BrokerType = QueueBrokerType.RabbitMq, | ||
Connection = new QueueConnectionString | ||
{ | ||
Name = "Test", | ||
BrokerType = QueueBrokerType.RabbitMq, | ||
RabbitMqConnectionSettings = new RabbitMqConnectionSettings() { ConnectionString = "amqps://guest:guest@localhost:5672/" } | ||
} | ||
}; | ||
|
||
Assert.True(c.UsingEncryptedCommunicationChannel()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using FastTests.Voron; | ||
using Tests.Infrastructure; | ||
using Voron; | ||
using Voron.Impl; | ||
using Voron.Impl.Paging; | ||
using Xunit.Abstractions; | ||
|
||
namespace SlowTests.Voron.Issues; | ||
|
||
public unsafe class RavenDB_17997 : StorageTest | ||
{ | ||
public RavenDB_17997(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
protected override void Configure(StorageEnvironmentOptions options) | ||
{ | ||
options.ManualFlushing = true; | ||
options.ManualSyncing = true; | ||
} | ||
|
||
[RavenFact(RavenTestCategory.Voron)] | ||
public void MustNotReadFromUnmappedAllocation() | ||
{ | ||
var dataPager = Env.Options.DataPager; | ||
|
||
using (var tempTx = new TempPagerTransaction()) | ||
{ | ||
PagerState stateUsedDuringAcquirePagePointer; | ||
byte* ptr; | ||
|
||
{ | ||
// the below code show the wrong usage that we had in ApplyPagesToDataFileFromScratch() where we're not under write tx | ||
// if we don't pass pager state to AcquirePagePointer() then it will use the one from the pager instance which might get released because of AllocateMorePages() calls | ||
|
||
/* | ||
var state = dataPager.PagerState; | ||
state.AddRef(); | ||
dataPager.AllocateMorePages(4 * 1024 * 1024); | ||
dataPager.AllocateMorePages(8 * 1024 * 1024); | ||
stateUsedDuringAcquirePagePointer = dataPager.PagerState; | ||
ptr = dataPager.AcquirePagePointer(tempTx, 0); | ||
*/ | ||
} | ||
|
||
{ | ||
// correct usage should be to increment reference count of pager state and use that pager in AcquirePagePointer() | ||
stateUsedDuringAcquirePagePointer = dataPager.GetPagerStateAndAddRefAtomically(); | ||
|
||
dataPager.AllocateMorePages(4 * 1024 * 1024); | ||
dataPager.AllocateMorePages(8 * 1024 * 1024); | ||
|
||
ptr = dataPager.AcquirePagePointer(tempTx, 0, stateUsedDuringAcquirePagePointer); | ||
} | ||
|
||
dataPager.AllocateMorePages(16 * 1024 * 1024); | ||
|
||
if (ptr == stateUsedDuringAcquirePagePointer.MapBase && stateUsedDuringAcquirePagePointer._released) | ||
{ | ||
throw new InvalidOperationException("Cannot read from already unmapped allocation of memory mapped file"); | ||
} | ||
} | ||
} | ||
} |