DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Five Java Books Beginners and Professionals Should Read
  • Top Six React Development Tools
  • Constructing Real-Time Analytics: Fundamental Components and Architectural Framework — Part 2
  • Alpha Testing Tutorial: A Comprehensive Guide With Best Practices

Trending

  • Five Java Books Beginners and Professionals Should Read
  • Top Six React Development Tools
  • Constructing Real-Time Analytics: Fundamental Components and Architectural Framework — Part 2
  • Alpha Testing Tutorial: A Comprehensive Guide With Best Practices
  1. DZone
  2. Data Engineering
  3. Databases
  4. We Won't Be Fixing This Database Condition

We Won't Be Fixing This Database Condition

This is a much simpler alternative to going into a distributed mode reasoning just for something that is an operator error in the first place.

Oren Eini user avatar by
Oren Eini
·
Jul. 03, 17 · Opinion
Like (1)
Save
Tweet
Share
2.44K Views

Join the DZone community and get the full member experience.

Join For Free

During the work on restoring a backup, the developer in charge came up with the following problematic scenario.

  • Start restoring the backup of database Northwind on node A, which can take quite some time for a large database.
  • Create a database named Northwind on node B while the restore is taking place.

The problem is that during the restore, the database doesn’t exist in a proper form in the cluster until it is done restoring. During that time, if an administrator is attempting to create a database, it will look like it is working, but it will actually create a new database on all the other nodes and fail on the node where the restore is going on.

When the restore will complete, it will either remove the previously created database or it will join it and replicate the restored data to the rest of the nodes, depending exactly on when the restore and the new database creation happened.

Now, trying to resolve this issue involves us coordinating the restore process around the cluster. However, that also means that we need to do heartbeats during the restore process (to the entire cluster) and handle timeouts and recovery, and effectively take on a pretty big burden of pretty complicated code. Indeed, the first draft of the fix for this issue suffered from weaknesses such that it would only work when running on a single node, and only work in a cluster mode in very specific cases.

In this case, it is a very rare scenario that requires an admin (not just a standard user) to do two things that you’ll not usually expect them together, and the outcome of this is a bit confusing even if you manage the database, but there isn’t any data loss.

The solution was to document that during the restore process you shouldn’t create a database with the same name but instead let RavenDB complete and then let the database span additional nodes. That is a much simpler alternative to going into a distributed mode reasoning just for something that is an operator error in the first place.

Database

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Five Java Books Beginners and Professionals Should Read
  • Top Six React Development Tools
  • Constructing Real-Time Analytics: Fundamental Components and Architectural Framework — Part 2
  • Alpha Testing Tutorial: A Comprehensive Guide With Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: