Skip to content
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

Remove secondary caching in ContentDefinitionManager, improve error message in DataMigrationManager #16212

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7fda7cb
try fix ConcurrencyException
hyzx86 Jun 2, 2024
18386eb
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 2, 2024
0316bd9
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 4, 2024
c95057b
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 5, 2024
5050392
fix dependencies
hyzx86 Jun 5, 2024
a2f42c3
fix startup
hyzx86 Jun 5, 2024
fd79bad
clear
hyzx86 Jun 5, 2024
b4bd1a8
fix RequireFeatures
hyzx86 Jun 5, 2024
b26f81e
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 5, 2024
fa4483a
restore Feature on MigrationFile
hyzx86 Jun 5, 2024
36fbf40
Merge branch 'TypeUpdateConcurrencyException' of https://github.com/h…
hyzx86 Jun 5, 2024
414f1ef
update
hyzx86 Jun 5, 2024
55541bc
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 5, 2024
4fee32f
update MigrationName
hyzx86 Jun 5, 2024
4345ab3
Merge branch 'TypeUpdateConcurrencyException' of https://github.com/h…
hyzx86 Jun 5, 2024
0de24d1
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 5, 2024
b3ef613
fix migrationManger
hyzx86 Jun 5, 2024
739ecc1
Merge branch 'TypeUpdateConcurrencyException' of https://github.com/h…
hyzx86 Jun 5, 2024
f4282c7
clear
hyzx86 Jun 5, 2024
d83450e
restore changes
hyzx86 Jun 5, 2024
f0e3ba6
clear code
hyzx86 Jun 5, 2024
173f2d8
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 6, 2024
4185e4e
recurrence of problems
hyzx86 Jun 6, 2024
d1736cc
Remove L2 cache
hyzx86 Jun 6, 2024
68fe0f4
update use latest filter
hyzx86 Jun 6, 2024
bf3945f
restore changes
hyzx86 Jun 6, 2024
3514bb9
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 6, 2024
70c09c8
restore changes
hyzx86 Jun 6, 2024
204077e
Merge branch 'TypeUpdateConcurrencyException' of https://github.com/h…
hyzx86 Jun 6, 2024
7033644
Merge branch 'main' into TypeUpdateConcurrencyException
hyzx86 Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ static async Task<FluidValue> GetContentByHandleAsync(LiquidTemplateContext cont
services.AddScoped<IContentHandleProvider, ContentItemIdHandleProvider>();
services.AddScoped<IContentItemIndexHandler, ContentItemIndexCoordinator>();

services.AddDataMigration<Migrations>();

// Common Part
services.AddContentPart<CommonPart>()
.UseDisplayDriver<DateEditorDriver>()
Expand Down Expand Up @@ -242,6 +240,16 @@ public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilde
}
}

[Feature("OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget")]
public class ExportContentToDeploymentTargetStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddDataMigration<Migrations>();
}
}


[RequireFeatures("OrchardCore.Deployment")]
public class DeploymentStartup : StartupBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ public async Task<ContentTypeDefinition> LoadTypeDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name);

if (_scopedTypeDefinitions.TryGetValue(name, out var typeDefinition))
{
return typeDefinition;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebastienros should be the problem here, the Loadxx family of methods should no longer fetch content from the cache
/cc @MikeAlhayek

Copy link
Contributor Author

@hyzx86 hyzx86 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MikeAlhayek , do I need to revert these changes? Or do I keep them?
Because there is already a cache in the ContentDefinitionStore and a second-level cache would make the logic more complex

Copy link
Contributor Author

@hyzx86 hyzx86 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use both MemoryCache and Redis caching, it may have problems enabling distributed caching and multi-server deployments


var document = await _contentDefinitionStore.LoadContentDefinitionAsync();

return LoadTypeDefinition(document, name);
Expand All @@ -97,11 +92,6 @@ public async Task<ContentPartDefinition> LoadPartDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name);

if (_scopedPartDefinitions.TryGetValue(name, out var partDefinition))
{
return partDefinition;
}

var document = await _contentDefinitionStore.LoadContentDefinitionAsync();

return LoadPartDefinition(document, name);
Expand Down
Loading