SlideShare une entreprise Scribd logo
1  sur  28
APACHE SLING&FRIENDSTECHMEETUP
BERLIN, 26-28SEPTEMBER 2016
Into theTar Pit:A TarMKDeep Dive
Michael Dürig, Adobe Research
TarMK
adaptTo()2016 2
Servlet Engine
Content Repository
Sling
AEM
Application
OSGi
JREMongoMK
Oak Core
Oak JCR
RDBMK TarMK
TarMK
adaptTo()2016 3
 Embedded Database
 Hierarchical
 Fast / Small
 Limited scalability
 MVCC / Append only
Agenda
adaptTo()2016 4
 MVCC Persistence
 Revisions, Recovery, Rollback
 Garbage Collection
 Upcoming Improvements
adaptTo()2016 5
MVCC Persistence
UpdatingTrees
adaptTo()2016 6
B
D E
C
F
A
B
D E
C
F
A
C’
A’
G
Revisions
adaptTo()2016 7
R1 R2 R3 HEADHEADHEAD HEAD
PersistingRevisions
adaptTo()2016 8
B
D E
C
F
A
D E B F C A
cbde7a01-b30c-4716-a9a7-
29d7ce1f5838
7d78a945-4553-409b-adad-
7050256c05fe
57c76710-a690-4028-a498-26477293b5
Records and Segments
adaptTo() 2016 9
D E B F C A … … … …
Tar Files
adaptTo()2016 10
data00000a.tar
57c76710-a690-4028-a498-26477293b5
2236063c-77a0-47b0-a16a-30f4899990a4
d9f5b47d-0fea-4a77-aa8e-3fdc0302ef24
20bffcd4-9d48-46ca-a263-fa49ba1d8cb3
1d32af7d-3c1c-4892-a44a-44ae4a5d4e33
data00001a.tar
6e162b11-3782-47ca-a78d-4da12149df8d
9e884e53-b1b2-4906-a0a7-3a51c77579fd
090e4312-a115-44e8-ab47-0a89f380ab64
f2178987-09d2-48de-abc7-7718dc8b8c74
7e68db78-3aca-4a34-a72f-c174e8f8c93d
data00002b.tar
7911f3af-a286-4c4f-a944-8ed235c723e1
e098df2a-3958-4d4b-a651-6b8498c22f66
67d9fc69-d2d6-4543-a189-d24d4c00db67
ec4e2563-7d2e-4c54-a52f-9582c3a6fb54
f32f6bf8-c7cc-4e20-aa94-d2e783bf76d5
adaptTo()2016 11
Revisions, Recovery, Rollback
Recovery
adaptTo()2016 12
$ ls segmentstore
256M Aug 16 17:09 data00000a.tar
256M Aug 16 17:09 data00001a.tar
256M Aug 16 17:09 data00002a.tar
256M Aug 16 17:09 data00003a.tar
256M Aug 16 17:09 data00004a.tar
256M Aug 16 17:09 data00005a.tar
256M Aug 16 17:09 data00006a.tar
231M Aug 16 17:12 data00007a.tar
231M Aug 16 17:09 data00007a.tar.bak
256M Aug 16 17:12 data00008a.tar
182M Aug 16 17:12 data00009a.tar
147B Aug 16 17:09 journal.log
$ tar –tvf data0000a.tar
69644 Aug 16 17:09 0686c08d-e3f6-474e-bb32-874efca706e7.58dbce7b
262144 Aug 16 17:09 a3a57501-f30f-4986-b820-e166c50adaad.8d58d425
262144 Aug 16 17:09 8bf5c193-6458-4e29-b4f5-d0dbba5ca584.0a0ceeac
195080 Aug 16 17:09 2f6cbfdf-8d78-41d9-b507-89f47a143cab.47624a71
262144 Aug 16 17:09 7b8fd991-e894-49fb-b0e1-c193e5403755.da89a3db
262144 Aug 16 17:09 10d3ea6c-e62f-45d1-bd61-fab94db9cddd.da137b63
25600 Aug 16 17:09 data00000a.tar.gph
31232 Aug 16 17:09 data00000a.tar.idx
Recovery
adaptTo()2016 13
17:12:21.025 WARN Could not find a valid tar index in
[/segmentstore/data00007a.tar], recovering...
17:12:21.025 INFO Recovering segments from tar file
/segmentstore/data00007a.tar
17:12:21.739 INFO Backing up /segmentstore/data00007a.tar to
data00007a.tar.bak
17:12:21.739 INFO Regenerating tar file /segmentstore/data00007a.tar
Revisions
adaptTo()2016 14
$ cat journal.log
fd155d2d-516c-4274-aa83-0851bbc2eb47:102112 root
bb8b37a3-8129-45b7-a043-484a299523da:182460 root
639b7832-7fcc-4f42-abe7-48c4f5505850:162320 root
R1 R2HEAD HEAD
Rollback
adaptTo()2016 15
$ java -jar oak-run-*.jar check
usage: check <options>
Option Description
------ -----------
--bin [Long] read the n first bytes from binary properties.
-1 for all bytes. (default: 0)
--deep [Long] enable deep consistency checking. An optional
long specifies the number of seconds between
progress notifications (default: 9223372036854775807)
--journal journal file (default: journal.log)
--path path to the segment store (required)
Rollback
adaptTo()2016 16
$ java -jar oak-run-*.jar check --deep --path /segmentstore
21:52:07.149 INFO Searching for last good revision in journal.log
21:52:07.219 INFO Checking revision 639b7832-7fcc-4f42-abe7-
48c4f5505850:162320
21:52:07.227 ERROR Segment not found: 639b7832-7fcc-4f42-abe7-
48c4f5505850. Creation date delta is 6 ms.
21:52:07.227 INFO Error while traversing 639b7832-7fcc-4f42-abe7-
48c4f5505850:162320
21:52:07.228 INFO Broken revision 639b7832-7fcc-4f42-abe7-
48c4f5505850:162320
Rollback
adaptTo()2016 17
21:52:07.228 INFO Checking revision bb8b37a3-8129-45b7-a043-
484a299523da:182460
21:52:07.228 INFO Checking /
21:52:07.266 INFO Traversed 88 nodes and 103 properties
21:52:07.266 INFO Found latest good revision bb8b37a3-8129-45b7-a043-
484a299523da:182460
21:52:07.266 INFO Searched through 2 revisions
adaptTo()2016 18
Garbage Collection
OfflineRevisionsGC
adaptTo()2016 19
R1 R2 R3 R4 HEADHEAD
OfflineRevisionGC
adaptTo()2016 20
$ java –jar oak-run-*.jar compact segmentstore
Compacting segmenstore
before
Tue Aug 16 17:09:05 CEST 2016, data00000a.tar
Tue Aug 16 17:09:08 CEST 2016, data00001a.tar
...
size 2.6 GB (2582279827 bytes)
-> compacting
-> cleaning up
-> removed old file data00000a.tar
-> removed old file data00001a.tar
...
OfflineRevisionGC
adaptTo()2016 21
-> writing new journal.log:
3b632859-fafd-4113-a53a-335451933862:231132 root
after
Tue Aug 23 11:45:08 CEST 2016, data00000b.tar
Tue Aug 23 11:45:08 CEST 2016, data00001b.tar
...
size 546.4 MB (546363953 bytes)
removed files [data00000a.tar, ...]
added files [data00000b.tar, ...]
Compaction succeeded in 4.240 s (4s).
Online Revisions GC
adaptTo()2016 22
 Same as Offline
 BUT
ResourceContender
 Concurrentwrites
 CPU
 IO
 Locks
 Cachecoherence/ locality
Additional GC roots
 Heap
 Compacted head
Online Revisions GC:Roots
adaptTo()2016 23
R1 R2 R3 R4 HEAD
Session 1 Session 2 Session 3
JVM
adaptTo()2016 24
Upcoming Improvements
Online Revisions GC
adaptTo()2016 25
 Retentionby Generation
 Nogc roots from compacted head
 Ignore gc roots from heap
 Configurable retention time instead
 Cheaper than by reference
and beyond...
adaptTo()2016 26
 Partial and background gc
 Scalable
 Resumable
 Tunable
Conclusion
adaptTo()2016 27
 Many improvements for gc
 Changed storage format
 Migration required
 Ground work for futureimprovements
 More scalable gc
 Bigger repositories
 More write throughput
adaptTo()2016 28
Questions

Contenu connexe

En vedette

Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBMongoDB
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?connectwebex
 
New Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael MarthNew Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael MarthAEM HUB
 
Scala & sling
Scala & slingScala & sling
Scala & slingmichid
 
Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?Bertrand Delacretaz
 
Introducing Apache Jackrabbit OAK
Introducing Apache Jackrabbit OAKIntroducing Apache Jackrabbit OAK
Introducing Apache Jackrabbit OAKYash Mody
 
Hosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRHosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRWoonsan Ko
 
The architecture of oak
The architecture of oakThe architecture of oak
The architecture of oakMichael Dürig
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiCédric Hüsler
 
OpenCms Days 2016: Next generation content repository
OpenCms Days 2016: Next generation content repository OpenCms Days 2016: Next generation content repository
OpenCms Days 2016: Next generation content repository Alkacon Software GmbH & Co. KG
 
The Zero Bullshit Architecture
The Zero Bullshit ArchitectureThe Zero Bullshit Architecture
The Zero Bullshit ArchitectureLars Trieloff
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMconnectwebex
 
Introduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsIntroduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsStefano Celentano
 
Multi site manager
Multi site managerMulti site manager
Multi site managershivani garg
 
Adobe Meetup AEM Architecture Sydney 2015
Adobe Meetup AEM Architecture Sydney 2015Adobe Meetup AEM Architecture Sydney 2015
Adobe Meetup AEM Architecture Sydney 2015Michael Henderson
 
Microservices Architecture for AEM
Microservices Architecture for AEMMicroservices Architecture for AEM
Microservices Architecture for AEMMaciej Majchrzak
 
Mime Magic With Apache Tika
Mime Magic With Apache TikaMime Magic With Apache Tika
Mime Magic With Apache TikaJukka Zitting
 

En vedette (20)

Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?
 
New Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael MarthNew Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael Marth
 
Scala & sling
Scala & slingScala & sling
Scala & sling
 
Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?Can we run the Whole Web on Apache Sling?
Can we run the Whole Web on Apache Sling?
 
Introducing Apache Jackrabbit OAK
Introducing Apache Jackrabbit OAKIntroducing Apache Jackrabbit OAK
Introducing Apache Jackrabbit OAK
 
Hosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRHosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCR
 
The architecture of oak
The architecture of oakThe architecture of oak
The architecture of oak
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
JCR and ModeShape
JCR and ModeShapeJCR and ModeShape
JCR and ModeShape
 
OpenCms Days 2016: Next generation content repository
OpenCms Days 2016: Next generation content repository OpenCms Days 2016: Next generation content repository
OpenCms Days 2016: Next generation content repository
 
The Zero Bullshit Architecture
The Zero Bullshit ArchitectureThe Zero Bullshit Architecture
The Zero Bullshit Architecture
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
Introduction to JCR
Introduction to JCR Introduction to JCR
Introduction to JCR
 
Introduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsIntroduction to Sightly and Sling Models
Introduction to Sightly and Sling Models
 
Multi site manager
Multi site managerMulti site manager
Multi site manager
 
Adobe Meetup AEM Architecture Sydney 2015
Adobe Meetup AEM Architecture Sydney 2015Adobe Meetup AEM Architecture Sydney 2015
Adobe Meetup AEM Architecture Sydney 2015
 
Microservices Architecture for AEM
Microservices Architecture for AEMMicroservices Architecture for AEM
Microservices Architecture for AEM
 
JCR In 10 Minutes
JCR In 10 MinutesJCR In 10 Minutes
JCR In 10 Minutes
 
Mime Magic With Apache Tika
Mime Magic With Apache TikaMime Magic With Apache Tika
Mime Magic With Apache Tika
 

Similaire à Deep Dive into Apache Sling TarMK Persistence and Revision Handling

TechEvent Performance Analyses on Standby Database
TechEvent Performance Analyses on Standby DatabaseTechEvent Performance Analyses on Standby Database
TechEvent Performance Analyses on Standby DatabaseTrivadis
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingSteve Smith
 
Experiences with Power 9 at A*STAR CRC
Experiences with Power 9 at A*STAR CRCExperiences with Power 9 at A*STAR CRC
Experiences with Power 9 at A*STAR CRCGanesan Narayanasamy
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cuzzal basak
 
Oracle-GoldenGate-18c-Workshop-Lab-16.docx
Oracle-GoldenGate-18c-Workshop-Lab-16.docxOracle-GoldenGate-18c-Workshop-Lab-16.docx
Oracle-GoldenGate-18c-Workshop-Lab-16.docxtricantino1973
 
Scaling the #2ndhalf
Scaling the #2ndhalfScaling the #2ndhalf
Scaling the #2ndhalfSalo Shp
 
Jboss World 2011 Infinispan
Jboss World 2011 InfinispanJboss World 2011 Infinispan
Jboss World 2011 Infinispancbo_
 
Some Essentials of TCB
Some Essentials of TCBSome Essentials of TCB
Some Essentials of TCBHugo Pristauz
 
A Beginner's Manual for PyRx
A Beginner's Manual for PyRxA Beginner's Manual for PyRx
A Beginner's Manual for PyRxJohn Cahill
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Brendan Gregg
 
GoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docx
GoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docxGoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docx
GoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docxtricantino1973
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedBrendan Gregg
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerSteve Smith
 
IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...
IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...
IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...Lixi Conrads
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Nelson Calero
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF AbyssSasha Goldshtein
 
PGI Compilers & Tools Update- March 2018
PGI Compilers & Tools Update- March 2018PGI Compilers & Tools Update- March 2018
PGI Compilers & Tools Update- March 2018NVIDIA
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in descriptionPrzemyslaw Koltermann
 

Similaire à Deep Dive into Apache Sling TarMK Persistence and Revision Handling (20)

TechEvent Performance Analyses on Standby Database
TechEvent Performance Analyses on Standby DatabaseTechEvent Performance Analyses on Standby Database
TechEvent Performance Analyses on Standby Database
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration training
 
Experiences with Power 9 at A*STAR CRC
Experiences with Power 9 at A*STAR CRCExperiences with Power 9 at A*STAR CRC
Experiences with Power 9 at A*STAR CRC
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
Oracle-GoldenGate-18c-Workshop-Lab-16.docx
Oracle-GoldenGate-18c-Workshop-Lab-16.docxOracle-GoldenGate-18c-Workshop-Lab-16.docx
Oracle-GoldenGate-18c-Workshop-Lab-16.docx
 
Performance Risk Management
Performance Risk ManagementPerformance Risk Management
Performance Risk Management
 
Scaling the #2ndhalf
Scaling the #2ndhalfScaling the #2ndhalf
Scaling the #2ndhalf
 
Jboss World 2011 Infinispan
Jboss World 2011 InfinispanJboss World 2011 Infinispan
Jboss World 2011 Infinispan
 
Some Essentials of TCB
Some Essentials of TCBSome Essentials of TCB
Some Essentials of TCB
 
A Beginner's Manual for PyRx
A Beginner's Manual for PyRxA Beginner's Manual for PyRx
A Beginner's Manual for PyRx
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
 
GoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docx
GoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docxGoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docx
GoldenGate-12c-Advanced-Workshop-Lab-Exercise-1.docx
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...
IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...
IGUANA: A Generic Framework for Benchmarking the Read-Write Performance of Tr...
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
 
ARLYN
ARLYNARLYN
ARLYN
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
PGI Compilers & Tools Update- March 2018
PGI Compilers & Tools Update- March 2018PGI Compilers & Tools Update- March 2018
PGI Compilers & Tools Update- March 2018
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 

Dernier

Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 

Dernier (20)

Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 

Deep Dive into Apache Sling TarMK Persistence and Revision Handling

Notes de l'éditeur

  1. Ever wondered what is inside the TarMK's tar files? What is a segment and what is a record? How garbage collection works and why (or why not)? This session will answer these questions and many more. It will shed light on the inner working of the TarMK, its system requirements and performance characteristics. It will help participants to better understand and diagnose the cause of common problems and present tools and techniques for diagnosing and debugging. Finally there will be a preview of what new features and enhancements we are currently working on.
  2. The TarMK is a tiny part of the whole AEM stack. It is one of multiple persistence options of the Java Content Repository implementation Jackrabbit Oak.
  3. The TarMK is a fast, small and simple embedded hierarchical database engine serving as a persistence backend for the Jackrabbit Oak Java Content Repository. It implements multi-version concurrency control and stores all data in tar files in an append only way.
  4. Multi version concurrency control coordinates concurrent access by giving users (the illusion of having) exclusive access to the repository.
  5. Updating a tree creates a complete new copy of that tree. Unchanged nodes are referenced in the previous tree to avoid duplicating them. Note how changing any node will always cause its whole parent hierarchy to change.
  6. Conceptually each changed node creates a new tree. Unless the same node is edited over and over again each tree references all its predecessors. Each tree represents a revisions of the repository. The ordered list of the trees form a revision history, which reflects how the repository evolved to its present state. For the TarMK a revision is represented by the identifier of the root node of the respective tree and a revision history is simply a list of such identifiers.
  7. A revision is persisted by serialising the nodes of its respective tree into a stream of records. Serialisation progresses in post order to ensure dependencies are always stored first. This guarantees that a serialised node is always fully readable even if a crash occurs at anytime.
  8. To make records addressable the stream of records is chunked up into segments. A segment is identified by a random UUID (its segment id). Segments contain some header information and a list of records. Records are addressable inside a segment via its offset. A record id is thus a pair consisting of a segment id and an offset. The maximum size of a segment is determined by its address space. The offset of a record id is a 16 bit integer and records are 4 byte aligned in their segment resulting in a maximal segment size of 262'144 bytes.
  9. Segments are appended into tar files. Once a tar file becomes full (265MB by default) some auxiliary entries are added and a new tar file is started. Subsequent tar file names include an ever increasing sequence number to maintain a strict order. The auxiliary entries consist of an index of the segments for quicker lookup and a list of segments referenced from this tar files for analysing reachability during garbage collection. The letter in the tar file’s names refer to its generation. When the garbage collector is able to collect enough segments from a tar file such that there is at least 25% space saving for that file, the file is rewritten into a new generation leaving out the garbage collected segments. By default tar files are memory mapped for fast access. So it is important to avoid allocating all available RAM to the JVM (e.g. heap) as otherwise the OS would not have enough space for memory mapping the tar files, which could lead to some form of thrashing.
  10. Writing everything in a way such that it only references already written items makes the persistence format resilient against unclean shutdown, crashes, power cuts etc. In these cases recovery is automatic and transparent during the next start-up. More sever corruptions (e.g. bit flip in tar files) need manual intervention to resolve. However, the MVCC nature of the TarMK makes it easy to roll back to the last good state.
  11. Backup files in a directory listing indicate that a automatic recovery has occurred at start-up. In the case of a crash the tar file that has been last written to might become corrupt. As it hasn’t been cleanly closed it will have a missing or corrupt index (the .idx file is always written last and it is check-summed). In the recovery case corrupt tar files are backed up, all recoverable entries are written to a new tar file and a new graph and index entry is added.
  12. Excerpt of log file entries when an automatic recovery of a tar file occurs at start-up. The process recovers all valid segment entries from the corrupt tar file and regenerates the graph and index entries. The original tar file is backed up before the regenerated one is created.
  13. The journal.log file contains an ordered list of revisions (record ids of root nodes) where later entries are appended to the end of the file. Removing entries from the end of the journal causes a roll back of the TarMK to a previous revision.
  14. The check run mode of the oak-run utility can be used to find the latest good revision. It traverses all revisions from the journal backward until it finds a good one. Command line arguments specify how thoroughly individual revisions should be checked. In particular the --bin option controls than handling of binaries. Specifying 0 skips reading binaries, which is useful when a blob store is configured. The check process does not modify the repository itself but rather outputs the first good revision it finds (if any). Editing the journal.log file needs to be done manually.
  15. oak-run check outputs the record ids of the revisions it is checking and any errors that occur along the way.
  16. Once oak-run check found a good revision it will output its record id. Note, that the TarMK also has a basic variant of rolling back the journal.log build into its start up behaviour: if the latest record id in the journal.log cannot be accessed (e.g. because its segment is missing), it will log a warning “Unable to access revision f2178987-09d2-48de-abc7-7718dc8b8c74.63b8, rewinding..” and tries continuing with the previous record id in the journal.
  17. While the append only storage model has many advantages, it leads to a store that only ever grows. No amount of removed nodes will cause the store to shrink. A garbage collection process is required to free space used by unreferenced records. Garbage collection can either run online (concurrent to normal repository operation) or offline ( with exclusive access to the store). Conceptually both modes are almost the same. Their efficacy can greatly vary though.
  18. Since tar files, segments and records are immutable, the garbage collector cannot just remove unreferenced items. Instead it will clone the current head state such that it doesn’t reference previous states anymore. This is called the compaction phase as it creates a compact representation of the current head state. The subsequent clean-up phase removes segments containing the old, now unreferenced states. Clean-up creates a new generation of any tar file containing at least 25% of garbage (non referenced segments) and removing the old tar file. New tar files have its generation letter increased. E.g. data00000a.tar will become data00000b.tar.
  19. When running offline revision garbage collection oak-run compact outputs a list of current tar files, the current size of the repository, the steps it is performing (compacting, cleaning up) and a list of the tar files it removed.
  20. It will update the journal to only contain the record id of the new head stated created in the compaction phase and subsequently output a list of tar files after garbage collection concluded as well as the final size, a list of removed files, a list of added files and the time the whole process took.
  21. Online revision garbage collection works the same as offline only that it is started from within a running TarMK instance. However, running within an live instance leads to some additional complications: Traversing the reachability graph is expensive as the respective graphs are enormously dense. It is a contender for system resources (CPU, disk, lock). As it is a scan operation it also has advert affects on caches that are hot for normal system operation. An additional estimation phase should avoid online revision garbage collection from running if not enough garbage has been accumulated. Unfortunately the estimation phase already has similar effects on normal system operation as the garbage collection process itself. The compaction phase races against concurrent writes: when a write was performed concurrently to the compactor creating the clone of the current head state, the new changes need to be compacted first. This process can repeat multiple times as concurrent writes occur. The number of retries can be configured and there is an option to eventually force compaction by acquiring exclusive write access to the store. Both, giving up and forcing compaction is not optimal though. In the first case a lot of work is just thrown away and in the second case concurrent writes start piling up until the compactor eventually finished. There are additional gc root from the heap and from later generations blocking segments from being removed when they wouldn’t be blocked in the offline revision gc case.
  22. Additional gc roots are introduced by A subtle implementation problem during the compaction process. This problem will cause the clone of the head stated created by the compaction phase to reference record in an older revision. The application on top of the TarMK referencing older revisions. As a JCR session is based on the head revision from the time it was opened, that revision will ultimately be referenced from the JVM’s heap. Together with the enormous density of the reference graph above two issues often cause the clean-up phase to be less effective than desired.
  23. Improving online revision garbage collection requires changes in the segment format. Repositories of older formats are incompatible to the new format and need to be migrated.
  24. The problem with the compacted head referencing older states is fixed in the next version of the TarMK. This leads to a clear separation between gc generations. That is, each time compaction is performed a new generation is written that does not have a reference to any previous generation. To avoid references from heap (“old sessions”) to block clean up from removing old revisions, a retention time base clean-up mechanism is employed: by default anything that is older that one generation is removed and sessions still referring to such old revisions are automatically refreshed to the current head revision.
  25. In preparation for further improvements (mainly wrt. to performance and scalability) we are working on further changes to the storage format. To improve scalability we mainly aim at making garbage collection a background process that would run during idle times. At the same time there is attempts to partition the compaction step such that it would be possible to run partial garbage collections (i.e. on parts of the tree).