Назад | Перейти на главную страницу

Непрерывная доступность Windows медленно с System.IO.DirectoryInfo

у нас есть общий ресурс в отказоустойчивом кластере Windows с включенной «Непрерывной доступностью».
Работает на Windows Server 2019
Когда мы создаем папку и проверяем, сколько времени требуется, чтобы вернуть существующий дескриптор, всегда остается около 5 секунд.
Когда мы отключили «Непрерывную доступность», оно снизилось до 0,0016498 секунд.

Я тестировал это с помощью этого скрипта:

$pathString = "\\hostname\sharename\user\jon.doe"
$owner = "DOMAIN\OWNER"

$exists = $false

$directorySecurity = New-Object System.Security.AccessControl.DirectorySecurity;

[System.IO.Directory]::CreateDirectory($pathString, $directorySecurity);

$dirInfo = New-Object System.IO.DirectoryInfo($pathString); 
$dirSec = $dirInfo.GetAccessControl(); 
$fileSystemAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($owner, [System.Security.AccessControl.FileSystemRights]::FullControl, [System.Security.AccessControl.AccessControlType]::Allow)

$dirSec.AddAccessRule($fileSystemAccessRule); 
$dirInfo.SetAccessControl($dirSec);



$sw = [Diagnostics.Stopwatch]::StartNew()

while (! $exists) {
    $dirInfoCheck = New-Object System.IO.DirectoryInfo($pathString);

    if ($dirInfoCheck.Exists) {
        $sw.Stop()
        $sw.Elapsed
        $exists = $true

        Write-Host "Root exists: " . $dirInfoCheck.Root.Exists
        # $dirInfoCheck.Root.GetDirectories();
        Test-Path $pathString
        $dirInfoCheck.Refresh()
        Write-Host "Directory exists: " $dirInfoCheck.Exists
    }
}
del $pathString

Это нормальное поведение? Это где-нибудь задокументировано Microsoft?