[MAGNOLIA-6694] Meta data conversion modifies node status Created: 14/Jun/16  Updated: 21/Jun/16  Resolved: 20/Jun/16

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 5.4.6
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lars Fischer Assignee: Robert Šiška
Resolution: Obsolete Votes: 0
Labels: metadata, migration, quickwin, tasks
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MataDataAsMixinConversionHelper.patch    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: Do not use MgnlPropertySetting decorator on update
Sprint: Kromeriz 49
Story Points: 0

 Description   

The conversion of the old node meta data structure to the new mixin format *in a migration context * causes the state of nodes to be modified. This prevents having the same activation states as on the initial systems.

The flow during migration is as follows:

  • Tasks: ConvertMetaDataUpdateTask.doExcute()
  • MetaDataAsMixinConversionHelper.convertNodeAndChildren() to process node and it’s children.

—> MgnlPropertySettingContentDecorator.ChangeLastUpdateDateOp.doExec() to add nodes to dirtyOps

  • MetaDataAsMixinConversionHelper will call the saving session for every 20 nodes:

if (periodicSaves && nodesProcessed % PERIODIC_SAVE_FREQUENCY == 0)

{ node.getSession().save(); }

—> MgnlPropertySettingContentDecorator. MgnlPropertySettingSessionWrapper.save()
—> MgnlPropertySettingContentDecorator. MgnlPropertySettingSessionWrapper. applyPendingChanges()
**The LastModified will be updated in this method by:

if (session.nodeExists(dirty.getPath())) {
log.debug("Updating {} with {}", dirty.getPath(), dirty.getUpdateDate());
LastModified.update(session.getNode(dirty.getPath()), dirty.getUserName(), dirty.getUpdateDate());
} else {
// can happen when deleting something that was modified or moved within same session
if (log.isDebugEnabled()) {
log.warn("wanted to update {}:{} modified by:{} at {} but it's gone now.", session.getWorkspace().getName(), dirty.getPath(), dirty.getUserName(), dirty.getUpdateDate());
}
}

Regarding to Jan H. the node must be unwrapped before further processing to prevent the unwanted modifications.

See the attached patch file about how to unwrap the node.


Generated at Mon Feb 12 04:16:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.