Subject | Re: Remote Shadows (again...) |
---|---|
Author | m_theologos |
Post date | 2006-10-04T17:44:30Z |
--- In Firebird-Architect@yahoogroups.com, Alex Peshkov <pes@...>
wrote:
We have in winnt.cpp:
FIL PIO_create(DBB dbb, TEXT * string, SSHORT length, BOOLEAN
overwrite)
{
/**************************************
*
* P I O _ c r e a t e
*
**************************************
*
* Functional description
* Create a new database file.
*
**************************************/
HANDLE desc;
FIL file;
TEXT workspace[MAXPATHLEN];
TEXT *file_name;
file_name = string;
if (length)
{
MOVE_FAST(file_name, workspace, length);
workspace[length] = 0;
file_name = workspace;
}
desc = CreateFile(file_name,
GENERIC_READ | GENERIC_WRITE,
g_dwShareFlags,
NULL,
(overwrite ? CREATE_ALWAYS :
CREATE_NEW),
FILE_ATTRIBUTE_NORMAL |
g_dwExtraFlags,
0);
Where:
#ifdef SUPERSERVER_V2
static const DWORD g_dwShareFlags = FILE_SHARE_READ; // no write
sharing
static const DWORD g_dwExtraFlags = FILE_FLAG_OVERLAPPED |
FILE_FLAG_NO_BUFFERING |
FILE_FLAG_RANDOM_ACCESS;
So, if these are the 'special flags' then the (official)
documentation of Win32 SDK states that the CreateFile function works
with UNC path-names ie. \\<Server>\<Share> so it's transparent. (The
CreateFile documentation is available upon request). But I don't
believe until I see. (IMHO, I tend to trust them, though). So, if
you're so kind to build an experimental super-server to test it...
Of course, if we agree that this feature should be implemented. At
least for SS architecture which is straightforward.
Neither I don't trust (generally). But I must admit that the Win2003
and WinXP are pretty stable at least from the developer POV.
m.th.
wrote:
>....
> Writing pages to database file is not trivial process - in order tobe
> able to recover database after system failure we must ensurecorrect
> order of pages written to the disk, this is known as 'safe writeorder'.
> OS often does it's best to break safe write order - for example, itmovement
> optimizes order of pages to be written to the disk to minimize
> of HDD heads. We set special flags when opening databases file toavoid
> such optimizations. Not necessary to mention, that safe write ordershadow.
> should be kept for shadows too. And here is an answer why NFS is a
> special case - it can keep safe write order of pages in database
>safe
> I'm not very familiar with windows file sharing. If one gives us a
> reference (to MSDN, for example), which describes how to guarantee
> write order for windows-based network, I see no problems enablingwrite
> shadowing across MS network. Without guarantees of keeping safe
> order, shadowing may become very dangerous feature - you can easilyget
> a heap of useless bytes instead of a normal database in your shadow.IOW in Windows terms (please correct me if I'm wrong):
>
We have in winnt.cpp:
FIL PIO_create(DBB dbb, TEXT * string, SSHORT length, BOOLEAN
overwrite)
{
/**************************************
*
* P I O _ c r e a t e
*
**************************************
*
* Functional description
* Create a new database file.
*
**************************************/
HANDLE desc;
FIL file;
TEXT workspace[MAXPATHLEN];
TEXT *file_name;
file_name = string;
if (length)
{
MOVE_FAST(file_name, workspace, length);
workspace[length] = 0;
file_name = workspace;
}
desc = CreateFile(file_name,
GENERIC_READ | GENERIC_WRITE,
g_dwShareFlags,
NULL,
(overwrite ? CREATE_ALWAYS :
CREATE_NEW),
FILE_ATTRIBUTE_NORMAL |
g_dwExtraFlags,
0);
Where:
#ifdef SUPERSERVER_V2
static const DWORD g_dwShareFlags = FILE_SHARE_READ; // no write
sharing
static const DWORD g_dwExtraFlags = FILE_FLAG_OVERLAPPED |
FILE_FLAG_NO_BUFFERING |
FILE_FLAG_RANDOM_ACCESS;
So, if these are the 'special flags' then the (official)
documentation of Win32 SDK states that the CreateFile function works
with UNC path-names ie. \\<Server>\<Share> so it's transparent. (The
CreateFile documentation is available upon request). But I don't
believe until I see. (IMHO, I tend to trust them, though). So, if
you're so kind to build an experimental super-server to test it...
> What about performance problems on network shadows. They are nottoo
> big. As soon as you take into account that all reads are done fromyou
> primary database file, and only writes are repeated for shadows,
> will notice that there are no big problems here. Next, if you usedon't
> dedicated 1GBit link for shadow, you have approx 100MBytes/sec
> throughput, which is exactly what good hard disk has (certainly I
> speak about high-end devices - 10GBit network should be used inhigh-end
> case).very
>
> Concerning reliability - from my own experience NFS does it's work
> well. One of our customers had a 'wonderful' UPS which used to turnoff
> output voltage at random moments. But they never had broken mirror,MS
> though in some cases they had broken primary file!
>
> Summarizing - if we can guarantee safe write order for some network
> protocol, enabling shadows over it is very good feature. Though for
> products some crash-tests should be also fine - I do not trust M$products.
>Guarantee = give me a small super-server kit and I'll tell you... :)
> Alex.
>
Of course, if we agree that this feature should be implemented. At
least for SS architecture which is straightforward.
Neither I don't trust (generally). But I must admit that the Win2003
and WinXP are pretty stable at least from the developer POV.
m.th.