Table of Contents
Multipath feature is for enabling backup in complex situations but at the same time not causing any downtime for users as a whole or to individual users.
![]() | Note |
|---|---|
| In this doc, I explain using mail server as an example. But multipath feature is completely generic and can be used in similar situations and this is module independent. | |
Without multipath feature there are two ways mail server backup can be implemented using Autodir.
Here backup is killed every time SMTP/POP/IMAP access is made. And SMTP delivery is so random that backup is almost interrupted for heavy email users. If this is not the issue, this could be right choice in some implementations.
Instead of getting killed every time SMTP/POP/IMAP access is made, backup process can use backup locks created explicitly by backup process itself or using -n option so that backup program can get uninterruptable time to backup. Once the backup is finished and backup process removes the backup lock in case backup lock was created, access to the directory is given again. But when this method is used, there are some chances such that all access to email by user is denied for the movement backup is run. This could be the choice for most of the sites with proper -t and -w values.
When you want to choose second option but you can not tolerate if email user get delayed for couple of minutes even very occasionally for so called reason of lost productivity, then multipath approach is to consider.
![]() | Note |
|---|---|
Multipath approach is not for out of the box solution. If you opt for more you have pay the price for it. | |
So what is the price here? I will discuss about it little later.
I refer to SMTP server term very loosely. It includes all components that deal with mail delivery to the local user.
Similarly, POP/IMAP server as loose definition for all components which retrieve mail from local storage for email user.
I assume, home directory is used for mail storage in this document.
Multipath approach uses two paths. It is similar to having two doors to the same room. Similarly here too, two different paths used to the same directory.
But one way they differ from each other is by priority.
Multipath example: One that is regular path /home/user1 and another non standard path /home/.user1. But both lead to the same home directory for the user user1.
Low priority path: /home/user1
High priority path: /home/.user1
![]() | Note |
|---|---|
The dot before user1 in high priority path. | |
If backup started by Autodir is still running and process which try to access low priority path is blocked until backup process does not terminate. It is recommended for backup process to create backup lock file. If the backup lock file creation fails because some other process already held it or for any other reason, backup process should terminate immediately. This way any process which try to access low priority path has the option of checking lock file before being blocked by autofs.
![]() | Important |
|---|---|
This works only when -n option selected. If -n option not selected then both paths are considered high priority paths. | |
As the name suggests, if any process access directory through this path, then it will not be blocked but given access immediately by killing backup if it is running.
![]() | Important |
|---|---|
If backup is killed when high priority path accessed or by any other means backup is killed, process blocked in low priority path are also given access to the directory. | |
If used Autodir supports non standard high priority path to the same existing directory with dot appended to the directory as shown in the above example. This path considered high priority path.
This is not specific to multipath. It can be used independently. It simply blocks all processes until backup terminates when low priority path used.
![]() | Note |
|---|---|
Without this option low priority path is also considered as high priority path. | |
For high priority path, default is to use '.' character appended to the regular directory. But with this option other than dot character can be selected.
Example for option -x
if -x _ is selected, then from previous example,
Low priority path: /home/user1
High priority path: /home/_user1
![]() | Note |
|---|---|
| The under score before user1 in high priority path. | |
In case of mail servers, there are two kinds of access. Access by SMTP servers and access by POP/IMAP servers.
SMTP servers should use low priority path. And when backup is running, mail delivery is blocked. It is decided this way because, mail is not read until POP/IMAP server access it. Until then we can block SMTP servers.
POP/IMAP servers should use high priority path. As soon as high priority path accessed, backup is killed and both low priority and high priority paths allowed access.
This approach has many advantages and at the same time it is very simple.
Good support over network for NFS and other file servers.
All that is needed is at most changing 'one single line' in POP/IMAP servers instead of adding or modifying lines and files of code in all SMTP/POP/IMAP servers. This can be done by any C programmer in matter of minutes.
Please refer to above section. It needs modification of POP/IMAP servers in a subtle way.
![]() | Note |
|---|---|
Before going to details, I assume having knowledge of Autodir backup locks. | |
Backup locks when used with multipath, differs in some ways to the regular semantics. There are three scenarios when multipath and backup locks are used simultaneously.
This can be used instead of using option -n by backup programs. But when high priority path accessed backup process is still killed.
Low priority path will function as before. It has nothing to do with backup lock used for high priority path. It means, any process still can access low priority path and modify contents when backup is not running even when high priority path backup lock is held. But process which access high priority path still be blocked until backup lock is held.
All processes which access low and high priority paths will be blocked until backup lock is held by backup/recovery process.
This document, Autodir and multipaths, is copyrighted (c) 2005 by Venkata Ramana Enaganti. This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.