stable

Clone or download

Read-only

Move all artifact creation/update transactions to DBTransactionExecutorWithConnection

The main purpose is to introduce a transaction at artifact creation for the creation of first artifact changeset. As there are already transactions in a few places (like Attachment field) and there is a trick related to artifact link creation and hierarchy (a changeset is created automagically behind the scene) we need to convert a bunch of transactions. On a platform with ~200k artifacts the SQL gains are noticable: -31% of SQL time. When we combine both (index on artifact_priority_rank), the creation of a new artifact goes from 330ms to 173ms of wall time (-47%). The SQL part goes from 188ms to 51ms (-73%). Part of request #14048 Slowness at artifact creation Change-Id: I1da6067e68c81ab114b4f7bf93fdbcda8dc4cad6

Modified Files

Name
M plugins/tracker/include/REST/v1/ArtifactTemporaryFilesResource.class.php +3 −2 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactsResource.class.php +4 −1 Go to diff View file
M plugins/tracker/include/Tracker/Action/MoveArtifact.php +19 −14 Go to diff View file
M plugins/tracker/include/Tracker/Admin/ArtifactLinksUsageDao.php +1 −5 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Attachment/TemporaryFileDao.php +0 −5 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Attachment/TemporaryFileManager.class.php +30 −27 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetCreatorBase.class.php +103 −99 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Exception/ChangesetCommitException.class.php +2 −2 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/RecentlyVisited/RecentlyVisitedDao.php +2 −6 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/RecentlyVisited/VisitRecorder.php +14 −2 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_Artifact.class.php +20 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_ArtifactCreator.class.php +13 −2 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_ArtifactFactory.class.php +3 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/XMLImportBuilder.class.php +6 −2 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/dao/PriorityDao.class.php +33 −32 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/dao/Tracker_ArtifactDao.class.php +7 −11 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Field/ArtifactLink/SourceOfAssociationCollection.php +4 −2 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_File.class.php +2 −1 Go to diff View file
M plugins/tracker/include/Tracker/Migration/MigrationManager.php +6 −2 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +6 −2 Go to diff View file
M plugins/tracker/include/trackerPlugin.php +3 −2 Go to diff View file
A plugins/tracker/phpunit/Tracker/Artifact/Attachment/TemporaryFileManagerAppendChunkTest.php +141 −0 Go to diff View file
A plugins/tracker/phpunit/Tracker/Artifact/Attachment/TemporaryFileManagerGetDiskUsageTest.php +106 −0 Go to diff View file
A plugins/tracker/phpunit/Tracker/Artifact/Attachment/TemporaryFileManagerPurgeTest.php +110 −0 Go to diff View file
A plugins/tracker/phpunit/Tracker/Artifact/Attachment/TemporaryFileManagerSaveTest.php +106 −0 Go to diff View file
M plugins/tracker/phpunit/Tracker/Artifact/RecentlyVisited/VisitRecorderTest.php +3 −1 Go to diff View file
R plugins/tracker/tests/Artifact/Tracker_ArtifactCreatorTest.php Go to diff View file
D plugins/tracker/tests/Artifact/Attachment/TemporaryFileManagerTest.php +0 −251 Go to diff View file
M plugins/tracker/tests/Tracker_ArtifactTest.php +8 −2 Go to diff View file
M src/common/DB/DBTransactionExecutor.php +2 −1 Go to diff View file
M src/common/DB/DBTransactionExecutorWithConnection.php +7 −2 Go to diff View file
M src/common/REST/Header.class.php +2 −2 Go to diff View file
M tests/lib/DB/DBTransactionExecutorPassthrough.php +2 −2 Go to diff View file
A tests/lib/FakeDataAccessResult.php +63 −0 Go to diff View file
M tests/phpunit/tests/DB/DBTransactionExecutorPassthroughTest.php +12 −0 Go to diff View file
M tests/rest/tests/ArtifactsTest.php +1 −1 Go to diff View file