SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Orphans, Corruption, Careful Write, and 
Logging, 
or 
Gfix says my database is CORRUPT 
or 
Database Integrity - then, now, future 
Ann W. Harrison 
James A. Starkey
A Word of Thanks to our Sponsors
And to Vlad Khorsun 
Core 4562 
Some errors reported by database validation (such as 
orphan pages and a few others) are not critical for 
database, i.e. don’t affect query results andor logical 
consistency of user data. 
Such defects should not be counted as errors to not 
scare users. 
Fixed 28 Sept 2014
Questions?
MVCC – Quick Review 
Read consistency, undo, and update concurrency 
provided in one durable mechanism. 
Data is never overwritten. 
Update or Delete creates new record version linked to old. 
Transaction reads the version committed when it started 
(or at the instant for Read Committed) 
Each record chain has at most one uncommitted version. 
Rollback removes uncommitted version. 
.
What does Gfix do? 
Reads entire database verifying internal consistency: 
Of interest now: 
Allocated pages are in use 
Unused pages are not allocated 
Primary record links to 
Fragments 
Back versions 
Before 28 September 2014, any problem was an error
What are Orphans? 
And what do they have to do with this? (not what you 
think)
Database Integrity 
Disasters occur (more often circa 1985) 
Database System, O/S, Network, Power, Disk 
Classic Solutions 
Write Ahead Log 
Shadow Pages 
After image Log 
Firebird Solution 
Careful write, multi-version records 
Write once
Disk Failure 
InterBase V1 
Journal 
After image 
Abandoned by Borland 
Shadow 
Complete copy on separate disk 
Better done in RAID
Careful Write 
Order writes to disk (fsync) 
Database is always consistent on disk 
Rule: write the object pointed to then the pointer 
Record examples: record before index, back 
version before main, fragment before main record 
Page examples: mark as allocated before using, 
release before marking free 
Requires disciplined development
Record Before Index 
Indexes are always considered “noisy” 
Start at the first value below desired value 
Stop at next value above 
Index will be written before commit completes 
After crash: 
New uncommitted records not in index 
Uncommitted deleted records stay in index 
Gfix reports index corruption
Back Version Before Record 
When the back version is on a different page 
Write the back version first 
Write the record pointing to the back version next 
After crash: 
Old record still exists 
New back version wastes space 
Gfix reports orphan back versions
Fragment Before Record 
Record bigger than page size 
Write the last page of the record 
Write the next to last, point to the last 
Write other pages in reverse order, pointing to prior 
Write the first bit, pointing to next page 
After crash: 
Record fragments are unusable space 
Gfix reports orphan record fragments
Page Allocation 
Allocation: 
Mark page as allocated on PIP 
Format page 
Enter page in table, index, or internal structure 
After crash: 
Page is unusable 
Gfix reports orphan page
Page Release 
Release 
Remove page from table or index 
Mark page as unallocated 
After crash: 
Page is unusable 
Gfix reports orphan page
Precedence 
If index page A points to a record on page B, page B 
must be written before page A. 
If the record on page B has a back version on page C, 
page C must be written before page B. 
Firebird maintains a complete graph of precedence. 
If a cache conflict requires writing page A, C and B must 
be written first. 
If the graph develops a cycle, all pages must be written.
Downsides of Careful Write 
Writes are random. 
Precedence may cause multiple writes. 
Cycles cause multiple writes.
Design is Balance 
Performance Recoverability
Disaster Recovery 
From DBMS crash 
From OS crash 
From CPU crash 
From Network failure 
From Disk Crash
Antediluvian Technology 
Long Term Journaling 
Before and after page images are journalled 
Required a Tape Drive (now extinct) 
Recovery 
Roll forward from dump 
Rollback from the current disk image 
Performance bounded by tape speed
JRD’s Across History 
1980 1990 2000 2010 2014 
Rdb/ELN 
InterBase 
Firebird 
Netfrastructure 
Falcon 
Development NuoDB 
Closed Source 
Open Source 
AmorphousDB
Interbase 1.0, 1985 
(Actually gds/Galaxy 1.0) 
MVCC + Careful Write 
Disk shadowing (raid not invented yet) 
GLTJ: Long term journal server 
Dumped database to journal when enabled 
Journalled page changes (or full page) 
GLTJ could be shared among databases 
Rarely, if ever, used 
Performance constrained by disk speed
Falcon 
MVCC in memory 
Disk used as back-fill for memory 
Serial log for recovery 
Single log per database 
Page changes posted to log 
Log written with non-buffered writes 
Pages written when convenient 
Performance constrained by CPU
NuoDB 
DB layered on distributed objects called Atoms 
Atoms replicate peer to peer 
MVCC at Atom level 
Transaction nodes pump SQL transactions 
Storage managers persist serialized Atoms 
Storage managers use serial log for replication 
messages
NuoDB Transactions 
DBA has control over commit policy: 
Commit when transaction node sends commit 
messages 
Commit when <n> storage managers acknowledge 
commit messages 
Commit when <n> storage managers have written 
commit messages to serial log
Performance Implications 
Disk Based MVCC 
Many disk writes per transaction 
Batch commit is possible 
Performance is dozens of transactions per second with 
forced write 
Higher transaction rate with buffered writes, but at risk 
of data loss 
SSDs are a big win
Performance Implications 
Serial Log 
With fine granularity threading and 8 cores, 
benchmarked at 22,000 TPS 
Serial log management is critical 
Requires substantial non-interlocked data structures
Performance Implications 
NuoDB 
Bench marked at 3,000,000 TPS running on 40 
commodity processors 
Read only TPS is theoretically infinite
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS
Tom Laszewski
 
Vm13 vnx mixed workloads
Vm13 vnx mixed workloadsVm13 vnx mixed workloads
Vm13 vnx mixed workloads
pittmantony
 
Varrow madness 2013 virtualizing sql presentation
Varrow madness 2013 virtualizing sql presentationVarrow madness 2013 virtualizing sql presentation
Varrow madness 2013 virtualizing sql presentation
pittmantony
 

Was ist angesagt? (20)

Breaking IO Performance Barriers: Scalable Parallel File System for AWS
Breaking IO Performance Barriers: Scalable Parallel File System for AWSBreaking IO Performance Barriers: Scalable Parallel File System for AWS
Breaking IO Performance Barriers: Scalable Parallel File System for AWS
 
Developing imperfect software
Developing imperfect softwareDeveloping imperfect software
Developing imperfect software
 
Bcache and Aerospike
Bcache and AerospikeBcache and Aerospike
Bcache and Aerospike
 
Geographically Distributed Multi-Master MySQL Clusters
Geographically Distributed Multi-Master MySQL ClustersGeographically Distributed Multi-Master MySQL Clusters
Geographically Distributed Multi-Master MySQL Clusters
 
Right-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual MachineRight-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual Machine
 
AEM WITH MONGODB
AEM WITH MONGODBAEM WITH MONGODB
AEM WITH MONGODB
 
IaaS for DBAs in Azure
IaaS for DBAs in AzureIaaS for DBAs in Azure
IaaS for DBAs in Azure
 
Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)
 
Configuring MongoDB HA Replica Set on AWS EC2
Configuring MongoDB HA Replica Set on AWS EC2Configuring MongoDB HA Replica Set on AWS EC2
Configuring MongoDB HA Replica Set on AWS EC2
 
Effectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMEffectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEM
 
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsNordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOps
 
Managing storage on Prem and in Cloud
Managing storage on Prem and in CloudManaging storage on Prem and in Cloud
Managing storage on Prem and in Cloud
 
How to scale your web app
How to scale your web appHow to scale your web app
How to scale your web app
 
Varrow datacenter storage today and tomorrow
Varrow   datacenter storage today and tomorrowVarrow   datacenter storage today and tomorrow
Varrow datacenter storage today and tomorrow
 
PowerDNS with MySQL
PowerDNS with MySQLPowerDNS with MySQL
PowerDNS with MySQL
 
Kickstart to Windows azure
Kickstart to Windows azureKickstart to Windows azure
Kickstart to Windows azure
 
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS
 
Vm13 vnx mixed workloads
Vm13 vnx mixed workloadsVm13 vnx mixed workloads
Vm13 vnx mixed workloads
 
Varrow madness 2013 virtualizing sql presentation
Varrow madness 2013 virtualizing sql presentationVarrow madness 2013 virtualizing sql presentation
Varrow madness 2013 virtualizing sql presentation
 

Andere mochten auch

04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
artba
 
Artba Senate Finance Committee May
Artba Senate Finance Committee MayArtba Senate Finance Committee May
Artba Senate Finance Committee May
artba
 
How to translate patient information leaflets
How to translate patient information leafletsHow to translate patient information leaflets
How to translate patient information leaflets
Maja Źróbecka, MITI
 
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Simon Devitt Photographer
 
02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee
artba
 

Andere mochten auch (19)

04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
 
Accessibility Matters: Making Your Product Available to Everyone
Accessibility Matters: Making Your Product Available to EveryoneAccessibility Matters: Making Your Product Available to Everyone
Accessibility Matters: Making Your Product Available to Everyone
 
Artba Senate Finance Committee May
Artba Senate Finance Committee MayArtba Senate Finance Committee May
Artba Senate Finance Committee May
 
FHWA MOU with the State of Alaska Regarding Delegation of CEs.
FHWA MOU with the State of Alaska Regarding Delegation of CEs.FHWA MOU with the State of Alaska Regarding Delegation of CEs.
FHWA MOU with the State of Alaska Regarding Delegation of CEs.
 
How to translate patient information leaflets
How to translate patient information leafletsHow to translate patient information leaflets
How to translate patient information leaflets
 
New York Times Ad opposing tighter ozone standards
New York Times Ad opposing tighter ozone standardsNew York Times Ad opposing tighter ozone standards
New York Times Ad opposing tighter ozone standards
 
Multi-Industry Letter to Congress on EPA Ozone Standards
Multi-Industry Letter to Congress on EPA Ozone StandardsMulti-Industry Letter to Congress on EPA Ozone Standards
Multi-Industry Letter to Congress on EPA Ozone Standards
 
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
Athfield house, Wellington, New Zealand (Architect: Ian Athfield)
 
Keeping Denial of Service and Financial Fraud out of Your Contact Center
Keeping Denial of Service and Financial Fraud out of Your Contact CenterKeeping Denial of Service and Financial Fraud out of Your Contact Center
Keeping Denial of Service and Financial Fraud out of Your Contact Center
 
Coalition Comments on OSHA Clarification to Workplace Injury and Illness Regu...
Coalition Comments on OSHA Clarification to Workplace Injury and Illness Regu...Coalition Comments on OSHA Clarification to Workplace Injury and Illness Regu...
Coalition Comments on OSHA Clarification to Workplace Injury and Illness Regu...
 
Comments Objecting to ESA protections for the Long-Eared Bat
Comments Objecting to ESA protections for the Long-Eared BatComments Objecting to ESA protections for the Long-Eared Bat
Comments Objecting to ESA protections for the Long-Eared Bat
 
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
 
Harvey house
Harvey houseHarvey house
Harvey house
 
Accessibility Matters - Supplemental Links
Accessibility Matters - Supplemental LinksAccessibility Matters - Supplemental Links
Accessibility Matters - Supplemental Links
 
The Experience Comes First (STC New England - InterChange2016)
The Experience Comes First (STC New England - InterChange2016)The Experience Comes First (STC New England - InterChange2016)
The Experience Comes First (STC New England - InterChange2016)
 
Git Going With DVCS v1.1
Git Going With DVCS v1.1Git Going With DVCS v1.1
Git Going With DVCS v1.1
 
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
 
How does Linked Open Data change the publishing landscape?
How does Linked Open Data change the publishing landscape?How does Linked Open Data change the publishing landscape?
How does Linked Open Data change the publishing landscape?
 
02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee
 

Ähnlich wie Orphans, Corruption, Careful Write, and Logging

CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
J Singh
 
Dsm (Distributed computing)
Dsm (Distributed computing)Dsm (Distributed computing)
Dsm (Distributed computing)
Sri Prasanna
 
Storage, San And Business Continuity Overview
Storage, San And Business Continuity OverviewStorage, San And Business Continuity Overview
Storage, San And Business Continuity Overview
Alan McSweeney
 

Ähnlich wie Orphans, Corruption, Careful Write, and Logging (20)

How Data Instant Replay and Data Progression Work Together
How Data Instant Replay and Data Progression Work TogetherHow Data Instant Replay and Data Progression Work Together
How Data Instant Replay and Data Progression Work Together
 
Lifting the Blinds: Monitoring Windows Server 2012
Lifting the Blinds: Monitoring Windows Server 2012Lifting the Blinds: Monitoring Windows Server 2012
Lifting the Blinds: Monitoring Windows Server 2012
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale Systems
 
Experience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewExperience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's View
 
Dsm (Distributed computing)
Dsm (Distributed computing)Dsm (Distributed computing)
Dsm (Distributed computing)
 
Design Tradeoffs for SSD Performance
Design Tradeoffs for SSD PerformanceDesign Tradeoffs for SSD Performance
Design Tradeoffs for SSD Performance
 
Showdown: IBM DB2 versus Oracle Database for OLTP
Showdown: IBM DB2 versus Oracle Database for OLTPShowdown: IBM DB2 versus Oracle Database for OLTP
Showdown: IBM DB2 versus Oracle Database for OLTP
 
Apache ignite as in-memory computing platform
Apache ignite as in-memory computing platformApache ignite as in-memory computing platform
Apache ignite as in-memory computing platform
 
Demo 0.9.4
Demo 0.9.4Demo 0.9.4
Demo 0.9.4
 
Rdbms
Rdbms Rdbms
Rdbms
 
Storage, San And Business Continuity Overview
Storage, San And Business Continuity OverviewStorage, San And Business Continuity Overview
Storage, San And Business Continuity Overview
 
SQL 2005 Disk IO Performance
SQL 2005 Disk IO PerformanceSQL 2005 Disk IO Performance
SQL 2005 Disk IO Performance
 
Measuring Firebird Disk I/O
Measuring Firebird Disk I/OMeasuring Firebird Disk I/O
Measuring Firebird Disk I/O
 
15 bufferand records
15 bufferand records15 bufferand records
15 bufferand records
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)
 
Gfs
GfsGfs
Gfs
 
Sequential file programming patterns and performance with .net
Sequential  file programming patterns and performance with .netSequential  file programming patterns and performance with .net
Sequential file programming patterns and performance with .net
 

Mehr von Mind The Firebird

Tips for using Firebird system tables
Tips for using Firebird system tablesTips for using Firebird system tables
Tips for using Firebird system tables
Mind The Firebird
 
A year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerA year in the life of Firebird .Net provider
A year in the life of Firebird .Net provider
Mind The Firebird
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions work
Mind The Firebird
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
Mind The Firebird
 
Firebird Conference 2011 - Introduction
Firebird Conference 2011 - IntroductionFirebird Conference 2011 - Introduction
Firebird Conference 2011 - Introduction
Mind The Firebird
 

Mehr von Mind The Firebird (20)

Tips for using Firebird system tables
Tips for using Firebird system tablesTips for using Firebird system tables
Tips for using Firebird system tables
 
A year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerA year in the life of Firebird .Net provider
A year in the life of Firebird .Net provider
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions work
 
SuperServer in Firebird 3
SuperServer in Firebird 3SuperServer in Firebird 3
SuperServer in Firebird 3
 
Overview of RedDatabase 2.5
Overview of RedDatabase 2.5Overview of RedDatabase 2.5
Overview of RedDatabase 2.5
 
Creating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQLCreating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQL
 
Firebird Performance counters in details
Firebird Performance counters in detailsFirebird Performance counters in details
Firebird Performance counters in details
 
Understanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLUnderstanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQL
 
New SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunNew SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad Khorsun
 
Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016
 
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
 
Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databases
 
Stored procedures in Firebird
Stored procedures in FirebirdStored procedures in Firebird
Stored procedures in Firebird
 
Firebird on Linux
Firebird on LinuxFirebird on Linux
Firebird on Linux
 
Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...
 
Firebird meets NoSQL
Firebird meets NoSQLFirebird meets NoSQL
Firebird meets NoSQL
 
Continuous Database Monitoring with the Trace API
Continuous Database Monitoring with the Trace APIContinuous Database Monitoring with the Trace API
Continuous Database Monitoring with the Trace API
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
 
Firebird Conference 2011 - Introduction
Firebird Conference 2011 - IntroductionFirebird Conference 2011 - Introduction
Firebird Conference 2011 - Introduction
 
Firebird database recovery and protection for enterprises and ISV
Firebird database recovery and protection for enterprises and ISVFirebird database recovery and protection for enterprises and ISV
Firebird database recovery and protection for enterprises and ISV
 

Kürzlich hochgeladen

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 

Kürzlich hochgeladen (20)

WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

Orphans, Corruption, Careful Write, and Logging

  • 1. Orphans, Corruption, Careful Write, and Logging, or Gfix says my database is CORRUPT or Database Integrity - then, now, future Ann W. Harrison James A. Starkey
  • 2. A Word of Thanks to our Sponsors
  • 3. And to Vlad Khorsun Core 4562 Some errors reported by database validation (such as orphan pages and a few others) are not critical for database, i.e. don’t affect query results andor logical consistency of user data. Such defects should not be counted as errors to not scare users. Fixed 28 Sept 2014
  • 5. MVCC – Quick Review Read consistency, undo, and update concurrency provided in one durable mechanism. Data is never overwritten. Update or Delete creates new record version linked to old. Transaction reads the version committed when it started (or at the instant for Read Committed) Each record chain has at most one uncommitted version. Rollback removes uncommitted version. .
  • 6. What does Gfix do? Reads entire database verifying internal consistency: Of interest now: Allocated pages are in use Unused pages are not allocated Primary record links to Fragments Back versions Before 28 September 2014, any problem was an error
  • 7. What are Orphans? And what do they have to do with this? (not what you think)
  • 8. Database Integrity Disasters occur (more often circa 1985) Database System, O/S, Network, Power, Disk Classic Solutions Write Ahead Log Shadow Pages After image Log Firebird Solution Careful write, multi-version records Write once
  • 9. Disk Failure InterBase V1 Journal After image Abandoned by Borland Shadow Complete copy on separate disk Better done in RAID
  • 10. Careful Write Order writes to disk (fsync) Database is always consistent on disk Rule: write the object pointed to then the pointer Record examples: record before index, back version before main, fragment before main record Page examples: mark as allocated before using, release before marking free Requires disciplined development
  • 11. Record Before Index Indexes are always considered “noisy” Start at the first value below desired value Stop at next value above Index will be written before commit completes After crash: New uncommitted records not in index Uncommitted deleted records stay in index Gfix reports index corruption
  • 12. Back Version Before Record When the back version is on a different page Write the back version first Write the record pointing to the back version next After crash: Old record still exists New back version wastes space Gfix reports orphan back versions
  • 13. Fragment Before Record Record bigger than page size Write the last page of the record Write the next to last, point to the last Write other pages in reverse order, pointing to prior Write the first bit, pointing to next page After crash: Record fragments are unusable space Gfix reports orphan record fragments
  • 14. Page Allocation Allocation: Mark page as allocated on PIP Format page Enter page in table, index, or internal structure After crash: Page is unusable Gfix reports orphan page
  • 15. Page Release Release Remove page from table or index Mark page as unallocated After crash: Page is unusable Gfix reports orphan page
  • 16. Precedence If index page A points to a record on page B, page B must be written before page A. If the record on page B has a back version on page C, page C must be written before page B. Firebird maintains a complete graph of precedence. If a cache conflict requires writing page A, C and B must be written first. If the graph develops a cycle, all pages must be written.
  • 17. Downsides of Careful Write Writes are random. Precedence may cause multiple writes. Cycles cause multiple writes.
  • 18. Design is Balance Performance Recoverability
  • 19. Disaster Recovery From DBMS crash From OS crash From CPU crash From Network failure From Disk Crash
  • 20. Antediluvian Technology Long Term Journaling Before and after page images are journalled Required a Tape Drive (now extinct) Recovery Roll forward from dump Rollback from the current disk image Performance bounded by tape speed
  • 21. JRD’s Across History 1980 1990 2000 2010 2014 Rdb/ELN InterBase Firebird Netfrastructure Falcon Development NuoDB Closed Source Open Source AmorphousDB
  • 22. Interbase 1.0, 1985 (Actually gds/Galaxy 1.0) MVCC + Careful Write Disk shadowing (raid not invented yet) GLTJ: Long term journal server Dumped database to journal when enabled Journalled page changes (or full page) GLTJ could be shared among databases Rarely, if ever, used Performance constrained by disk speed
  • 23. Falcon MVCC in memory Disk used as back-fill for memory Serial log for recovery Single log per database Page changes posted to log Log written with non-buffered writes Pages written when convenient Performance constrained by CPU
  • 24. NuoDB DB layered on distributed objects called Atoms Atoms replicate peer to peer MVCC at Atom level Transaction nodes pump SQL transactions Storage managers persist serialized Atoms Storage managers use serial log for replication messages
  • 25. NuoDB Transactions DBA has control over commit policy: Commit when transaction node sends commit messages Commit when <n> storage managers acknowledge commit messages Commit when <n> storage managers have written commit messages to serial log
  • 26. Performance Implications Disk Based MVCC Many disk writes per transaction Batch commit is possible Performance is dozens of transactions per second with forced write Higher transaction rate with buffered writes, but at risk of data loss SSDs are a big win
  • 27. Performance Implications Serial Log With fine granularity threading and 8 cores, benchmarked at 22,000 TPS Serial log management is critical Requires substantial non-interlocked data structures
  • 28. Performance Implications NuoDB Bench marked at 3,000,000 TPS running on 40 commodity processors Read only TPS is theoretically infinite

Hinweis der Redaktion

  1. Since gfix will be more clear in V3, there’s not much to talk about…
  2. No, not that easy. First a review of the basic concurrency control mechanism of Firebird. Concurrency covers several areas: atomicity – a transaction succeeds or fails as a unit; isolation – a transaction is not affected by concurrent transactions; avoiding inconsistent reads and dirty writes; all done without locks.
  3. If anyone has missed gfix, it was originally known as Alice = because it handled everything that didn’t fit elsewhere, thus All Else. So it’s a grab bag of functions that run outside the database server. Gfix reads the database directly as if it were a file. The specific function of gfix that I’m talking about is its ability to validate a database’s internal consistency. Because it’s outside the server, it doesn’t know anything about database constraints or data formats. It won’t recoginize invalid data, non-functional referential constraints, duplicates in unique indexes, etc. However, it will recognize problems like index entries that don’t point to records, pages that are either doubly allocated or not allocated at all, records with back version pointers that don’t have back versions.
  4. So, gfix is looking for all those problems, how could they possibly occur in a robust database management system? From time to time, database systems stop cold. Local legend says that InterBase was used in Abrams tanks because the tanks suffered frequent short power failures. Unlike other database systems, InterBase restarted immediately. The cost of an immediate restart was that some