I am trying to patch the GenerateCacheKey processor of the mvc.renderRenering pipeline and for some reason my patch modifies the original processor (expected) but also adds a duplicate processor at the end of the pipeline section (unexpected). I'm using Sitecore 9.2.0 and my patch details are
Project.HtmlCache.RenderRendering.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<mvc.renderRendering>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.GenerateCacheKey, Sitecore.Mvc" resolve="true">
<patch:attribute name="type">MySolution.Project.HtmlCache.Pipelines.RenderRendering.GenerateCacheKey, MySolution.Project</patch:attribute>
</processor>
</mvc.renderRendering>
</pipelines>
</sitecore>
</configuration>
Which results in the configuration (seen in ShowConfig.aspx)
<mvc.renderRendering patch:source="sitecore.mvc.config">
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.InitializeProfiling, Sitecore.Mvc"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.StartStatisticRecording, Sitecore.Mvc"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.ResolveArea, Sitecore.Mvc">
<param type="Sitecore.Mvc.Pipelines.Response.RenderRendering.ChainedAreaResolveStrategy, Sitecore.Mvc" desc="areaResolver">
<Resolvers hint="list">
<resolver type="Sitecore.Mvc.Pipelines.Response.RenderRendering.RenderingDefinitionAreaResolveStrategy, Sitecore.Mvc"/>
<resolver type="Sitecore.Mvc.Pipelines.Response.RenderRendering.RenderingParametersAreaResolveStrategy, Sitecore.Mvc"/>
<resolver type="Sitecore.Mvc.Pipelines.Response.RenderRendering.RenderingLayoutAreaResolveStrategy, Sitecore.Mvc"/>
</Resolvers>
</param>
<param type="Sitecore.Mvc.AreaNamespaceRegistry, Sitecore.Mvc" desc="areaNamespaceRegistry"/>
</processor>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.SetCacheability, Sitecore.Mvc"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.EnterRenderingContext, Sitecore.Mvc"/>
<processor type="Spe.Integrations.Processors.ScriptedRenderRendering, Spe" patch:source="Spe.config"/>
<processor type="MySolution.Project.HtmlCache.Pipelines.RenderRendering.GenerateCacheKey, MySolution.Project" patch:source="Project.HtmlCache.RenderRendering.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.RenderFromCache, Sitecore.Mvc" resolve="true"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.StartRecordingOutput, Sitecore.Mvc"/>
<processor type="Sitecore.Mvc.ExperienceEditor.Pipelines.Response.RenderRendering.AddWrapper, Sitecore.Mvc.ExperienceEditor" resolve="true" patch:source="sitecore.mvc.experienceeditor.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer, Sitecore.Mvc">
<param type="Sitecore.Mvc.Pipelines.Response.RenderRendering.HttpExceptionWrappingRendererErrorStrategy, Sitecore.Mvc" desc="rendererErrorHandler">
<param type="Sitecore.Mvc.Pipelines.Response.RenderRendering.ChainedRendererErrorStrategy, Sitecore.Mvc" desc="rendererErrorHandler">
<Handlers hint="list">
<handler type="Sitecore.Mvc.Pipelines.Response.RenderRendering.PageModeRenderingErrorStrategy, Sitecore.Mvc"/>
</Handlers>
</param>
</param>
</processor>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.AddRecordedHtmlToCache, Sitecore.Mvc"/>
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.RecordStatistic, Sitecore.Mvc"/>
<processor type="MySolution.Project.HtmlCache.Pipelines.RenderRendering.GenerateCacheKey, MySolution.Project" patch:source="Project.HtmlCache.RenderRendering.config"/>
</mvc.renderRendering>
Edit
As Alina Fodor mentioned in her answer, duplicate settings should only happen if there is a spurious config file lying around. In my case, this was due to a stale config file remaining in my docker container which was no longer in the solution (most likely renamed/moved).
resolve="true"
attribute in your original processor (at least in showconfig you included in the ticket).