-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.4 to 6.0 merge #18507
5.4 to 6.0 merge #18507
Conversation
… are removed from cache.
-Move projections to use generic document instead of `Document`. -Track referenceCount for releasing the memory -Prevent leak in case of compressed db - Release all related memory to the projected document
…ing (indicates original document).
…rectGetInternal as base method to retrieve document from cache.
- When PulseTransaction creates a new transaction, we need to clear the cache to avoid invalid pointers - Move QueriedDocument to a dedicated file - Optimise QueriedDocument list for single reference - Rename variables within `QueriedDocument` to make them more meaningful - Handling of non-existing documents in the cache for memory calls
…ded the document but suspend the current document object.
- Created QueriedDocumentCache to move logic with QueriedDocument from LRU Dictionary - Unified disposal logic - Added assert messages - Explained OnPulse functionality in comment
- Asserts fix for map-reduce -In case of fanout projection we need to increase reference counter to avoid disposing document. -Avoid typeof(QueriedDocument) in QueryResultRetrieverBase -Added implementation for increasing/linking documents to LruDictionaries to avoid type casts in QueryResultRetrieverBase.
…ting document too long.
# Conflicts: # src/Raven.Server/Documents/Document.cs # src/Raven.Server/Documents/DocumentsStorage.cs # src/Raven.Server/Documents/Indexes/Persistence/Corax/CoraxIndexQueryingScope.cs # src/Raven.Server/Documents/Indexes/Persistence/Corax/CoraxIndexReadOperation.cs # src/Raven.Server/Documents/Indexes/Persistence/IndexOperationBase.cs # src/Raven.Server/Documents/Indexes/Persistence/IndexReadOperationBase.cs # src/Raven.Server/Documents/Indexes/Persistence/Lucene/LuceneIndexReadOperation.cs # src/Raven.Server/Documents/Indexes/Persistence/QueryFilter.cs # src/Raven.Server/Documents/Queries/CollectionQueryEnumerable.cs # src/Raven.Server/Documents/Queries/Results/GraphQueryResultRetriever.cs # src/Raven.Server/Documents/Queries/Results/IQueryResultRetriever.cs # src/Raven.Server/Documents/Queries/Results/MapQueryResultRetriever.cs # src/Raven.Server/Documents/Queries/Results/MapReduceQueryResultRetriever.cs # src/Raven.Server/Documents/Queries/Results/QueryResultRetrieverBase.cs # src/Raven.Server/Documents/Queries/Results/TimeSeries/TimeSeriesRetriever.cs # src/Raven.Server/Documents/ResourceCache.cs # test/Tests.Infrastructure/RavenTestCategory.cs
test this in debug please |
test this in debug please |
public IEnumerable<Document> GetDocumentsStartingWith(DocumentsOperationContext context, string idPrefix, string startAfterId, | ||
long start, long take, string collection, Reference<long> skippedResults, DocumentFields fields = DocumentFields.All, CancellationToken token = default) | ||
=> GetDocumentsStartingWith(context, idPrefix, startAfterId, start, take, collection, skippedResults, fields, token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> GetDocumentsStartingWith(context, idPrefix, startAfterId, start, take, collection, skippedResults, fields, token); | |
=> GetDocumentsStartingWith<Document>(context, idPrefix, startAfterId, start, take, collection, skippedResults, fields, token); |
otherwise it's recursive call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, we need to think about where this scenario might happen and add a test for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was unused, I've removed it. The only call to GetDocumentsStartingWith
is from CollectionQuery
which is now changed to QueriedDocument
.
public abstract class QueryResultRetrieverBase<TDocument> : QueryResultRetrieverCommon, IQueryResultRetriever<TDocument> | ||
where TDocument : Document, new() | ||
{ | ||
private const string CurrentRootDocumentMarker = "@root-doc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to create document with that id:
Maybe it's worth to add GUID to it? We use same tricks in Corax:
ravendb/src/Corax/Constants.cs
Lines 12 to 13 in 92df767
public const string BeforeAllKeys = "BeforeAllKeys-a8e5f221-613e-4eae-9962-2689e7c44506"; | |
public const string AfterAllKeys = "AfterAllKeys-3622a0bb-1cf4-4200-b830-5e937d57ac99"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it as it was earlier (string.Empty
) and not introduce a new marker here.
using Raven.Server.Documents.Queries.AST; | ||
|
||
namespace Raven.Server.Documents.Sharding.Queries; | ||
|
||
public sealed class ShardedQueryResultDocument : Document | ||
public sealed class ShardedQueryResultDocument : QueriedDocument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShardedQueryResultDocument
is from QueriedDocument
but ShardedMapReduceResultRetriever
is using Document
. Let's talk about it directly
…to avoid handling different document.
This PR merges the following changes from 5.4: