Skip to content

Commit

Permalink
Merge branch 'v6.0' into RavenDB-21956
Browse files Browse the repository at this point in the history
  • Loading branch information
djordjedjukic committed May 8, 2024
2 parents b2246d1 + cfbd791 commit 9454e07
Show file tree
Hide file tree
Showing 536 changed files with 18,334 additions and 12,973 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/FastTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- v6.0

env:
DOTNET_VERSION: 8.0.202
DOTNET_VERSION: 8.0.204


jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/FastTestsARM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: '30 6 * * *'

env:
DOTNET_VERSION: 8.0.202
DOTNET_VERSION: 8.0.204

jobs:
release:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ artifacts/

# DNX Studio
src/Raven.Studio/junit.xml
junit.xml
src/Raven.Studio/node_modules/
src/Raven.Studio/test.log
src/Raven.Studio/wwwroot/App/**/*.js
Expand Down
2 changes: 1 addition & 1 deletion bench/BulkInsert.Benchmark/BulkInsert.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AssemblyName>BulkInsert.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>BulkInsert.Benchmark</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion bench/Indexing.Benchmark/Indexing.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AssemblyName>Indexing.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Indexing.Benchmark</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion bench/Micro.Benchmark/Micro.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>Micro.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion bench/Regression.Benchmark/Regression.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>Regression.Benchmark</AssemblyName>
<PackageId>Regression.Benchmark</PackageId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AssemblyName>ServerStoreTxMerger.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>ServerStoreTxMerger.Benchmark</PackageId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<CodeAnalysisRuleSet>..\..\RavenDB.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AssemblyName>Subscriptions.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Subscriptions.Benchmark</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion bench/TimeSeries.Benchmark/TimeSeries.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions bench/Voron.Benchmark/Corax/CoraxEntryIdEncodings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public void GlobalSetup()
[Benchmark]
public Span<long> DiscardWithSimd()
{
EntryIdEncodings.DecodeAndDiscardFrequencyAvx2(_idsWithEncodingsForSimd, BufferSize);
EntryIdEncodings.DecodeAndDiscardFrequencyAvx2(_idsWithEncodingsForSimd, BufferSize);
EntryIdEncodings.DecodeAndDiscardFrequencyAvx2(_idsWithEncodingsForSimd, BufferSize);
EntryIdEncodings.DecodeAndDiscardFrequencyVector256(_idsWithEncodingsForSimd, BufferSize);
EntryIdEncodings.DecodeAndDiscardFrequencyVector256(_idsWithEncodingsForSimd, BufferSize);
EntryIdEncodings.DecodeAndDiscardFrequencyVector256(_idsWithEncodingsForSimd, BufferSize);

return _idsWithEncodingsForSimd;
}
Expand Down
8 changes: 4 additions & 4 deletions bench/Voron.Benchmark/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static List<Slice> GenerateWornoutTree(
var values = new List<Tuple<Slice, Slice>>();
var tree = tx.CreateTree(treeNameSlice);

while (tree.State.NumberOfEntries < generationTreeSize)
while (tree.State.Header.NumberOfEntries < generationTreeSize)
{
int deletions = 0;

Expand Down Expand Up @@ -144,9 +144,9 @@ public static List<Slice> GenerateWornoutTree(
// Delete the number of deletions given by the binomial rv
// We may have gone a little bit over the limit during
// insertion, but we rebalance here.
if (tree.State.NumberOfEntries > generationTreeSize)
if (tree.State.Header.NumberOfEntries > generationTreeSize)
{
while (tree.State.NumberOfEntries > generationTreeSize)
while (tree.State.Header.NumberOfEntries > generationTreeSize)
{
var keyIndex = generator.Next(treeKeys.Count);
tree.Delete(treeKeys[keyIndex]);
Expand All @@ -155,7 +155,7 @@ public static List<Slice> GenerateWornoutTree(
}
else
{
while (deletions > 0 && tree.State.NumberOfEntries > 0)
while (deletions > 0 && tree.State.Header.NumberOfEntries > 0)
{
var keyIndex = generator.Next(treeKeys.Count);
tree.Delete(treeKeys[keyIndex]);
Expand Down
2 changes: 1 addition & 1 deletion bench/Voron.Benchmark/Voron.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>Voron.Benchmark</AssemblyName>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion scripts/version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function BumpVersion ($projectDir, $versionPrefix, $buildType, $dryRun = $False)
$repo = @{
"Owner" = "ravendb"
"Name" = "ravendb"
"Branch" = "v6.0"
"Branch" = "release/v6.0"
}

$remoteFilePath = 'src/CommonAssemblyInfo.cs'
Expand Down
6 changes: 3 additions & 3 deletions src/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

[assembly: AssemblyCopyright("© Hibernating Rhinos 2009 - 2024 All rights reserved.")]

[assembly: AssemblyVersion("6.0.102")]
[assembly: AssemblyFileVersion("6.0.102.60")]
[assembly: AssemblyInformationalVersion("6.0.102")]
[assembly: AssemblyVersion("6.0.103")]
[assembly: AssemblyFileVersion("6.0.103.60")]
[assembly: AssemblyInformationalVersion("6.0.103")]

#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
Expand Down
2 changes: 1 addition & 1 deletion src/Corax/Corax.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>Corax - Low level indexing engine</Description>
<Authors>Hibernating Rhinos</Authors>
<TargetFramework>net8.0</TargetFramework>
<RuntimeFrameworkVersion>8.0.3</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>8.0.4</RuntimeFrameworkVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>Corax</AssemblyName>
<PackageId>Corax</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion src/Corax/Indexing/IndexWriter.Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private static void ThrowTriedToDeleteTermThatDoesNotExists(Slice term, IndexedF
$"Attempt to remove term: '{term}' for field {indexedField.Name}, but it does not exists! This is a bug.");
}

private static void ThrowMoreThanOneRemovalFoundForSingleItem(long idInTree, EntriesModifications entries, long existingEntryId, short existingFrequency)
private static void ThrowMoreThanOneRemovalFoundForSingleItem(long idInTree, in EntriesModifications entries, long existingEntryId, short existingFrequency)
{
throw new InvalidOperationException($"More than one removal found for a single item, which is impossible. " +
$"{Environment.NewLine}Current tree id: {idInTree}" +
Expand Down
2 changes: 1 addition & 1 deletion src/Corax/Indexing/IndexWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ IndexedField CreateDynamicField(Analyzer analyzer, FieldIndexingMode mode)
private void AddSuggestions(IndexedField field, Slice slice)
{
_hasSuggestions = true;
field.Suggestions ??= new Dictionary<Slice, int>();
field.Suggestions ??= new Dictionary<Slice, int>(SliceComparer.Instance);

if (_suggestionsTermsLengths == null || _suggestionsTermsLengths.Length < slice.Size)
_suggestionsTermsLengths = new int[Math.Max(2 * slice.Size, 32)];
Expand Down
9 changes: 4 additions & 5 deletions src/Corax/Querying/IndexSearcher.MultiUnaryMatches.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using Corax.Querying.Matches;
using System.Threading;
using Corax.Querying.Matches;
using Corax.Querying.Matches.Meta;

namespace Corax.Querying;

public partial class IndexSearcher
{
public MultiUnaryMatch<TInner> CreateMultiUnaryMatch<TInner>(TInner inner, MultiUnaryItem[] unaryItems)
public MultiUnaryMatch CreateMultiUnaryMatch<TInner>(TInner inner, MultiUnaryItem[] unaryItems, CancellationToken token = default)
where TInner : IQueryMatch
{
return new MultiUnaryMatch<TInner>(this, inner, unaryItems);
return MultiUnaryMatch.Create(new MultiUnaryMatch<TInner>(this, inner, unaryItems), token);
}


}
4 changes: 2 additions & 2 deletions src/Corax/Querying/IndexSearcher.Search.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private IQueryMatch SearchQueryLegacy(FieldMetadata field, IEnumerable<string> v
{
var termMatchesQuery = @operator switch
{
Constants.Search.Operator.And => AllInQuery(field, termMatches.ToHashSet(SliceComparer.Instance), skipEmptyItems: true, token: cancellationToken),
Constants.Search.Operator.And => AllInQuery(field, termMatches.ToHashSet(SliceComparer.Instance), token: cancellationToken),
Constants.Search.Operator.Or => InQuery(field, termMatches, token: cancellationToken),
_ => throw new ArgumentOutOfRangeException(nameof(@operator), @operator, null)
};
Expand Down Expand Up @@ -290,7 +290,7 @@ private IQueryMatch SearchQueryWithPhraseQuery(FieldMetadata field, IEnumerable<
{
var termMatchesQuery = @operator switch
{
Constants.Search.Operator.And => AllInQuery(field, termMatches.ToHashSet(SliceComparer.Instance), skipEmptyItems: true, token: cancellationToken),
Constants.Search.Operator.And => AllInQuery(field, termMatches.ToHashSet(SliceComparer.Instance), token: cancellationToken),
Constants.Search.Operator.Or => InQuery(field, termMatches, token: cancellationToken),
_ => throw new ArgumentOutOfRangeException(nameof(@operator), @operator, null)
};
Expand Down
4 changes: 2 additions & 2 deletions src/Corax/Querying/IndexSearcher.Suggestions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum StringDistanceAlgorithm
}
public partial class IndexSearcher
{
public IRawTermProvider Suggest(FieldMetadata field, string term, bool sortByPopularity, StringDistanceAlgorithm algorithm,
public IRawTermProvider Suggest(in FieldMetadata field, string term, bool sortByPopularity, StringDistanceAlgorithm algorithm,
float accuracy = Suggestions.DefaultAccuracy,
int take = Constants.IndexSearcher.TakeAll) => algorithm switch
{
Expand All @@ -26,7 +26,7 @@ public IRawTermProvider Suggest(FieldMetadata field, string term, bool sortByPop
_ => Suggest<LevenshteinDistance>(field, term, sortByPopularity, accuracy, take)
};

private SuggestionTermProvider<TDistanceProvider> Suggest<TDistanceProvider>(FieldMetadata field, string term, bool sortByPopularity, float accuracy = Suggestions.DefaultAccuracy, int take = Constants.IndexSearcher.TakeAll)
private SuggestionTermProvider<TDistanceProvider> Suggest<TDistanceProvider>(in FieldMetadata field, string term, bool sortByPopularity, float accuracy = Suggestions.DefaultAccuracy, int take = Constants.IndexSearcher.TakeAll)
where TDistanceProvider : IStringDistance
{
var termSlice = EncodeAndApplyAnalyzer(field, term);
Expand Down
8 changes: 4 additions & 4 deletions src/Corax/Querying/IndexSearcher.TermMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public TermMatch TermQuery<TNumeric>(in FieldMetadata field, TNumeric term, Comp

public Lookup<DoubleLookupKey> GetDoubleTermsFor(Slice name) =>_fieldsTree?.LookupFor<DoubleLookupKey>(name);

public TermMatch TermQuery(FieldMetadata field, string term, CompactTree termsTree = null)
public TermMatch TermQuery(in FieldMetadata field, string term, CompactTree termsTree = null)
{
var terms = termsTree ?? _fieldsTree?.CompactTreeFor(field.FieldName);
if (terms == null && term != null)
Expand Down Expand Up @@ -104,7 +104,7 @@ public TermMatch TermQuery(FieldMetadata field, string term, CompactTree termsTr
}

//Should be already analyzed...
public TermMatch TermQuery(FieldMetadata field, Slice term, CompactTree termsTree = null)
public TermMatch TermQuery(in FieldMetadata field, Slice term, CompactTree termsTree = null)
{
var terms = termsTree ?? _fieldsTree?.CompactTreeFor(field.FieldName);
if (terms == null)
Expand Down Expand Up @@ -192,7 +192,7 @@ public PostingList GetPostingList(long containerId)
return set;
}

public long NumberOfDocumentsUnderSpecificTerm<TData>(FieldMetadata binding, TData term)
public long NumberOfDocumentsUnderSpecificTerm<TData>(in FieldMetadata binding, TData term)
{
if (typeof(TData) == typeof(long))
{
Expand All @@ -208,7 +208,7 @@ public long NumberOfDocumentsUnderSpecificTerm<TData>(FieldMetadata binding, TDa
return NumberOfDocumentsUnderSpecificTerm(binding, (string)(object)term);
}

private long NumberOfDocumentsUnderSpecificTerm(FieldMetadata binding, string term)
private long NumberOfDocumentsUnderSpecificTerm(in FieldMetadata binding, string term)
{
var terms = _fieldsTree?.CompactTreeFor(binding.FieldName);
if (terms == null && term != null)
Expand Down
Loading

0 comments on commit 9454e07

Please sign in to comment.