Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjFkn-00048I-UQ for pgsql-bugs@arkaria.postgresql.org; Sun, 29 Nov 2020 06:00:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kjFkm-00030d-Jk for pgsql-bugs@arkaria.postgresql.org; Sun, 29 Nov 2020 06:00:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjFkm-00030V-77 for pgsql-bugs@lists.postgresql.org; Sun, 29 Nov 2020 06:00:08 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kjFki-0003Cj-Hm for pgsql-bugs@lists.postgresql.org; Sun, 29 Nov 2020 06:00:07 +0000 Received: by mail-lf1-x143.google.com with SMTP id u18so14010237lfd.9 for ; Sat, 28 Nov 2020 22:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=F0xToMCei4x6MbVenr+MCa6RW9cEOKDqKYcB8ll0Y5s=; b=mGb84cHAw+o3pgU+/fW/eob4zmFTLd0w0Sd02xqnMnzwVCuoAbwrbglctfu6v95aRh MWh5HFZbGGT8Yjjc29tDL7SoiDndJwt/KqtAGz0IDXoOU4akXSM66FWkBBwxRVIjto5g hwWbElb5WDIfuLh69d+E5pcoNmeOcTZayUv1W89lXylx+w04vGNtayIXevr9hlQas8Dv rZMRorJfXhr4k09S+EEFf+y8hUnzYc3wfUM7O8BqzKAhiwmkV1vf8fr6F/jgX7oiX3m8 9fyhl9Xug05SPzeD2laxNd4mRPqylhzZSCKD6u8ycOPG1+Ywxnm+GZAag9SoW7ZVmQFO Tgkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=F0xToMCei4x6MbVenr+MCa6RW9cEOKDqKYcB8ll0Y5s=; b=bxdcn2yfQa+oyPZVOKJqZ2V/SkEvQrA2KxTY2d8di9va+GDxGAnmF3XwklN65uhAA4 DZVAuaAwWkZIMj8RC6Aw7p7k8esJkCUv8x50UZCtfDq0d0FTvtN6FRd9a0fJulBKHPrE ysr1WATc9KylH/roCWuYAdmp09jmtMzKR2DFPKIHjLXO/TE83xfuYyWbSAe4E3zDb/Lp TpNkqwrFZg6pTQmnuIoJVlZJZSP55MQySkuVOTSSb3+sO5wlDC/y+nDxC6oW55eXb3Zm Xi4tJ8errO56fQPWWEmskYCga+9NWvcfJxUgAfSrbg267P5QyiIJsTrHC0Sa8oYu/kdM T4Pg== X-Gm-Message-State: AOAM532fCQkkidGIgYzzL8e1Qv+mjCRJQZhWX4VY9bGLyF3hh6bpwh3U B79fogqhxCy4beTe5l7GoQYfYQsFQv8= X-Google-Smtp-Source: ABdhPJzQbKKbLcouuE6sa0ejf/1xR+BPo+1JNM/WnQ84FeZ5l+a6r7JXcDdQ6YjtwNTAu9wLvR3SHw== X-Received: by 2002:a19:700b:: with SMTP id h11mr6462254lfc.298.1606629602963; Sat, 28 Nov 2020 22:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.4.248]) by smtp.gmail.com with ESMTPSA id a11sm1601702ljj.4.2020.11.28.22.00.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Nov 2020 22:00:02 -0800 (PST) Subject: Re: BUG #16750: VACUUM sporadically fails to access pgstat on Cygwin To: pgsql-bugs@lists.postgresql.org References: <16750-c08c3649092a21c8@postgresql.org> From: Alexander Lakhin Message-ID: Date: Sun, 29 Nov 2020 09:00:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <16750-c08c3649092a21c8@postgresql.org> Content-Type: multipart/mixed; boundary="------------C1D80E08413AF5D59149325C" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------C1D80E08413AF5D59149325C Content-Type: multipart/alternative; boundary="------------0CA6CB7BE5341FD3ABED33BE" --------------0CA6CB7BE5341FD3ABED33BE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 29.11.2020 08:00, PG Bug reporting form wrote: > pg_regress/vacuum WARNING: could not open statistics file > "/cygdrive/w/lorikeet/REL_12_STABLE/global.stat": Permission denied > pg_regress/create_index WARNING: could not open statistics file > "/cygdrive/w/lorikeet/REL_13_STABLE/global.stat": Device or resource busy > > The issue with the "Permission denied" error is already resolved for Windows > (see bug #16161), but cygwin still suffers from it. As I have found out, it happens when multiple VACUUM processes access the pgstat statistics. There can be the autovacuum process or just several VACUUM's executed simultaneously, i.e. we have the following scenario: The first process initiates a call to rename() in PgstatCollectorMain, via pgstat_vacuum_stat() -> backend_read_statsfile() -> pgstat_send_inquiry() | PgstatCollectorMain: pgstat_recv_inquiry() -> pending_write_requests -> pgstat_write_statsfiles() -> rename(tmpfile, statfile). The second proccess calls AllocateFile()/fopen(), via backend_read_statsfile() -> pgstat_read_db_statsfile_timestamp(). Also there can be third process that calls backend_read_statsfile() and thus fopen(), too. So one process (PgstatCollectorMain) tries to rename pg_stat_tmp/global.tmp to pg_stat_tmp/global.stat and another process (backend) tries to open it, and yet another one can have it open. The important fact is that rename() in cygwin() is not atomic at all, and it could be performed in two ways [1]. First, cygwin tries to execute IRP_MJ_SET_INFORMATION for global.tmp with "Type: SetRenameInformationFile, ReplaceIfExists: True, FileName: global.stat". (See LogFile-SharingViolation1.CSV attached.) If it fails with ACCESS_DENIED (because global.stat is open by another process, see line 51 of the log), it tries to replace file hard (and bad for us) way: IRP_MJ_CREATE for global.stat with "Desired Access: Delete, Disposition: Open.." (see line 78) and then IRP_MJ_WRITE, IRP_MJ_SET_INFORMATION, IRP_MJ_CLOSE... So the first possibility to fail for the opening backend is to get EBUSY error [1] (see line 89) . In this case we should just wait as we already do in pgwin32_open(). The second possibility is to get the EACCES error due to the delete pending state. But it's important to note that the global.stat file is not deleted at the end, it's replaced by global.tmp. So stat() just returns zero and in this case we shouldn't just return error (as in pgwin32_open). While fixing bug #16161 (when we added similar handling for the "delete pending" state) we've also encountered an issue [2]. There was a delay for 1 sec added on each open(directory) call as Windows returns ERROR_ACCESS_DENIED for such calls. Fortunately, cygwin doesn't do the same. It allows to open(directory) without an error, as the attached Logfile-006_logical_decoding.CSV shows. So the checking for stat() result is not necessary to prevent that behavior. There can be still unnecessary delay for 1 second in case of actual file permissions problems, but for now I see no code paths on cygwin where it can be significant. Please look at the proposed patch, that makes regress/vacuum test (and an extra test with three vacuums in parallel) pass reliably. Best regards, Alexander [1] https://cygwin.com/git?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/syscalls.cc;h=885ca375ac2b9afaa8fb85cb3f51cbffe9996a3d;hb=HEAD#l2728 [2] https://www.postgresql.org/message-id/b2b8cc4c-b7d7-0d1b-f6ee-a02bbef5bdd0%40gmail.com [16161] https://www.postgresql.org/message-id/flat/16161-7a985d2f1bbe8f71%40postgresql.org --------------0CA6CB7BE5341FD3ABED33BE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
29.11.2020 08:00, PG Bug reporting form wrote:
pg_regress/vacuum WARNING:  could not open statistics file
"/cygdrive/w/lorikeet/REL_12_STABLE/global.stat": Permission denied
pg_regress/create_index WARNING:  could not open statistics file
"/cygdrive/w/lorikeet/REL_13_STABLE/global.stat": Device or resource busy

The issue with the "Permission denied" error is already resolved for Windows
(see bug #16161), but cygwin still suffers from it.

As I have found out, it happens when multiple VACUUM processes access the pgstat statistics. There can be the autovacuum process or just several VACUUM's executed simultaneously, i.e. we have the following scenario:
The first process initiates a call to rename() in PgstatCollectorMain, via pgstat_vacuum_stat() -> backend_read_statsfile() -> pgstat_send_inquiry() | PgstatCollectorMain: pgstat_recv_inquiry() -> pending_write_requests -> pgstat_write_statsfiles() -> rename(tmpfile, statfile).
The second proccess calls AllocateFile()/fopen(), via backend_read_statsfile() -> pgstat_read_db_statsfile_timestamp().
Also there can be third process that calls backend_read_statsfile() and thus fopen(), too.

So one process (PgstatCollectorMain) tries to rename pg_stat_tmp/global.tmp to pg_stat_tmp/global.stat and another process (backend) tries to open it, and yet another one can have it open.

The important fact is that rename() in cygwin() is not atomic at all, and it could be performed in two ways [1]. First, cygwin tries to execute IRP_MJ_SET_INFORMATION for global.tmp with "Type: SetRenameInformationFile, ReplaceIfExists: True, FileName: global.stat". (See LogFile-SharingViolation1.CSV attached.)
If it fails with ACCESS_DENIED (because global.stat is open by another process, see line 51 of the log), it tries to replace file hard (and bad for us) way:
IRP_MJ_CREATE for global.stat with "Desired Access: Delete, Disposition: Open.." (see line 78) and then IRP_MJ_WRITE, IRP_MJ_SET_INFORMATION, IRP_MJ_CLOSE...

So the first possibility to fail for the opening backend is to get EBUSY error [1] (see line 89) . In this case we should just wait as we already do in pgwin32_open().

The second possibility is to get the EACCES error due to the delete pending state. But it's important to note that the global.stat file is not deleted at the end, it's replaced by global.tmp. So stat() just returns zero and in this case we shouldn't just return error (as in pgwin32_open).

While fixing bug #16161 (when we added similar handling for the "delete pending" state) we've also encountered an issue [2].
There was a delay for 1 sec added on each open(directory) call as Windows returns ERROR_ACCESS_DENIED for such calls.
Fortunately, cygwin doesn't do the same. It allows to open(directory) without an error, as the attached Logfile-006_logical_decoding.CSV shows.
So the checking for stat() result is not necessary to prevent that behavior.
There can be still unnecessary delay for 1 second in case of actual file permissions problems, but for now I see no code paths on cygwin where it can be significant.

Please look at the proposed patch, that makes regress/vacuum test (and an extra test with three vacuums in parallel) pass reliably.

Best regards,
Alexander

[1] https://cygwin.com/git?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/syscalls.cc;h=885ca375ac2b9afaa8fb85cb3f51cbffe9996a3d;hb=HEAD#l2728
[2] https://www.postgresql.org/message-id/b2b8cc4c-b7d7-0d1b-f6ee-a02bbef5bdd0%40gmail.com
[16161] https://www.postgresql.org/message-id/flat/16161-7a985d2f1bbe8f71%40postgresql.org
--------------0CA6CB7BE5341FD3ABED33BE-- --------------C1D80E08413AF5D59149325C Content-Type: text/csv; charset=UTF-8; name="Logfile-SharingViolation1.CSV" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="Logfile-SharingViolation1.CSV" "Time of Day","Process Name","PID","Operation","Path","Result","Detail" "8:00:27.5723721 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","" "8:00:27.5724082 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","" "8:00:27.5724219 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:27 AM, LastWriteTime: 11/25/2020 8:00:27 AM, ChangeTime: 11/25/2020 8:00:27 AM, FileAttributes: A, AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x594000000024dfd, EaSize: 0, Access: Generic Write, Read Attributes, Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement: Word" "8:00:27.5724480 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:27 AM, LastWriteTime: 11/25/2020 8:00:27 AM, ChangeTime: 11/25/2020 8:00:27 AM, FileAttributes: A, AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x594000000024dfd, EaSize: 0, Access: Generic Write, Read Attributes, Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement: Word" "8:00:27.5724585 AM","postgres.exe","2848","IRP_MJ_QUERY_SECURITY","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Information: Owner, Group, DACL" "8:00:27.5724873 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Offset: 0, Length: 2,033, Priority: Normal" "8:00:27.5725703 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","" "8:00:27.5725993 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","" "8:00:27.5726190 AM","postgres.exe","2848","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,905,285, Length: 53" "8:00:27.5727552 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5727791 AM","postgres.exe","2848","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.5727908 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:27 AM, LastWriteTime: 11/25/2020 8:00:27 AM, ChangeTime: 11/25/2020 8:00:27 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 2,033, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x594000000024dfd, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.5727996 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","" "8:00:27.5728087 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","" "8:00:27.5728750 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5728932 AM","postgres.exe","2848","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.5729023 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:26 AM, LastWriteTime: 11/25/2020 8:00:26 AM, ChangeTime: 11/25/2020 8:00:26 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 2,033, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x538000000024dfe, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.5729108 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","" "8:00:27.5729193 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","" "8:00:27.5729876 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","ACCESS DENIED","Desired Access: Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a" "8:00:27.5730656 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Desired Access: Delete, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5730920 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Type: QueryStandardInformationFile, AllocationSize: 4,096, EndOfFile: 2,033, NumberOfLinks: 1, DeletePending: False, Directory: False" "8:00:27.5731037 AM","postgres.exe","2848","FASTIO_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Type: QueryBasicInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:27 AM, LastWriteTime: 11/25/2020 8:00:27 AM, ChangeTime: 11/25/2020 8:00:27 AM, FileAttributes: A" "8:00:27.5731691 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp","SUCCESS","Desired Access: Write Data/Add File, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5732075 AM","postgres.exe","2848","IRP_MJ_SET_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.tmp","SUCCESS","Type: SetRenameInformationFile, ReplaceIfExists: True, FileName: C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat" "8:00:27.5733272 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","" "8:00:27.5733437 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp","SUCCESS","" "8:00:27.5733693 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp","SUCCESS","" "8:00:27.5734055 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","" "8:00:27.5734302 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\db_0.stat","SUCCESS","" "8:00:27.5734496 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Offset: 0, Length: 840, Priority: Normal" "8:00:27.5735090 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.5735357 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.5735514 AM","postgres.exe","2848","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,905,338, Length: 57" "8:00:27.5736293 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5736487 AM","postgres.exe","2848","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.5736583 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:27 AM, LastWriteTime: 11/25/2020 8:00:27 AM, ChangeTime: 11/25/2020 8:00:27 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x641000000024dfa, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.5736672 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.5736760 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.5737383 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5737548 AM","postgres.exe","2848","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.5737644 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:26 AM, LastWriteTime: 11/25/2020 8:00:26 AM, ChangeTime: 11/25/2020 8:00:26 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x656000000024df6, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.5737727 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.5737812 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.5738438 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","ACCESS DENIED","Desired Access: Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a" "8:00:27.5739143 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Desired Access: Delete, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5739345 AM","postgres.exe","2848","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Type: QueryStandardInformationFile, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False" "8:00:27.5739445 AM","postgres.exe","2848","FASTIO_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Type: QueryBasicInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:27 AM, LastWriteTime: 11/25/2020 8:00:27 AM, ChangeTime: 11/25/2020 8:00:27 AM, FileAttributes: A" "8:00:27.5740019 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp","SUCCESS","Desired Access: Write Data/Add File, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened" "8:00:27.5740381 AM","postgres.exe","2848","IRP_MJ_SET_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","ACCESS DENIED","Type: SetRenameInformationFile, ReplaceIfExists: True, FileName: C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat" "8:00:27.5740603 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp","SUCCESS","" "8:00:27.5740731 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp","SUCCESS","" "8:00:27.5740819 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.5740901 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.5742079 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Desired Access: Delete, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.6420444 AM","postgres.exe","2052","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,905,395, Length: 236" "8:00:27.6420897 AM","postgres.exe","2052","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:26 AM, LastWriteTime: 11/25/2020 8:00:26 AM, ChangeTime: 11/25/2020 8:00:26 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x656000000024df6, EaSize: 0, Access: Generic Read, Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement: Word" "8:00:27.6421147 AM","postgres.exe","2052","IRP_MJ_QUERY_SECURITY","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Information: Owner, Group, DACL" "8:00:27.6421437 AM","postgres.exe","2052","IRP_MJ_READ","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Offset: 0, Length: 840, Priority: Normal" "8:00:27.6421707 AM","postgres.exe","2052","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.6421878 AM","postgres.exe","2052","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.6434889 AM","postgres.exe","2840","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,905,631, Length: 220" "8:00:27.6734858 AM","postgres.exe","2848","FASTIO_ACQUIRE_FOR_CC_FLUSH","C:\$LogFile","SUCCESS","" "8:00:27.6734957 AM","postgres.exe","696","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,905,851, Length: 213" "8:00:27.6735139 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\$LogFile","SUCCESS","Offset: 11,227,136, Length: 45,056, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal" "8:00:27.6738112 AM","postgres.exe","2052","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,906,064, Length: 216" "8:00:27.6738359 AM","postgres.exe","2848","FASTIO_RELEASE_FOR_CC_FLUSH","C:\$LogFile","SUCCESS","" "8:00:27.6738604 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\$LogFile","SUCCESS","Offset: 73,728, Length: 20,480, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal" "8:00:27.7635491 AM","postgres.exe","2848","FASTIO_ACQUIRE_FOR_CC_FLUSH","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.7635773 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","Offset: 0, Length: 4,096, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal" "8:00:27.7637238 AM","postgres.exe","2848","FASTIO_RELEASE_FOR_CC_FLUSH","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.tmp","SUCCESS","" "8:00:27.7640995 AM","postgres.exe","696","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.7641834 AM","postgres.exe","696","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.7641928 AM","postgres.exe","2052","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.7641974 AM","postgres.exe","696","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:26 AM, LastWriteTime: 11/25/2020 8:00:26 AM, ChangeTime: 11/25/2020 8:00:26 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x656000000024df6, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.7642153 AM","postgres.exe","696","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7642429 AM","postgres.exe","2848","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Desired Access: Delete, Disposition: Open, Options: , Attributes: n/a, ShareMode: Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.7642511 AM","postgres.exe","2840","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "8:00:27.7642548 AM","postgres.exe","2052","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.7642719 AM","postgres.exe","2052","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:26 AM, LastWriteTime: 11/25/2020 8:00:26 AM, ChangeTime: 11/25/2020 8:00:26 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x656000000024df6, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.7642730 AM","postgres.exe","696","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7642793 AM","postgres.exe","2840","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "8:00:27.7642912 AM","postgres.exe","2840","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/25/2020 7:58:22 AM, LastAccessTime: 11/25/2020 8:00:26 AM, LastWriteTime: 11/25/2020 8:00:26 AM, ChangeTime: 11/25/2020 8:00:26 AM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 840, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x656000000024df6, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "8:00:27.7644832 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\$LogFile","SUCCESS","Offset: 24,576, Length: 4,096, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal" "8:00:27.7646508 AM","postgres.exe","2848","FASTIO_ACQUIRE_FOR_CC_FLUSH","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7646678 AM","postgres.exe","2848","IRP_MJ_WRITE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Offset: 0, Length: 4,096, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal" "8:00:27.7647756 AM","postgres.exe","2848","FASTIO_RELEASE_FOR_CC_FLUSH","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7647847 AM","postgres.exe","696","IRP_MJ_CREATE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SHARING VIOLATION","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" "8:00:27.7648158 AM","postgres.exe","2848","IRP_MJ_SET_INFORMATION","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","Type: SetDispositionInformationFile, Delete: True" "8:00:27.7648792 AM","postgres.exe","2848","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7648894 AM","postgres.exe","696","FASTIO_WRITE","C:\src\postgresql\src\test\regress\log\postmaster.log","SUCCESS","Offset: 7,906,280, Length: 92" "8:00:27.7649051 AM","postgres.exe","2840","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7649460 AM","postgres.exe","2052","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7650447 AM","postgres.exe","2848","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" "8:00:27.7650823 AM","postgres.exe","2052","IRP_MJ_CLOSE","C:\src\postgresql\src\test\regress\tmp_check\data\pg_stat_tmp\global.stat","SUCCESS","" --------------C1D80E08413AF5D59149325C Content-Type: text/csv; charset=UTF-8; name="Logfile-006_logical_decoding.CSV" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="Logfile-006_logical_decoding.CSV" "Time of Day","Process Name","PID","Operation","Path","Result","Detail" "10:33:33.7564341 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","Desired Access: Write Data/Add File, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7564657 AM","postgres.exe","1852","IRP_MJ_SET_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state.tmp","SUCCESS","Type: SetRenameInformationFile, ReplaceIfExists: True, FileName: C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state" "10:33:33.7565427 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","" "10:33:33.7565607 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","" "10:33:33.7565814 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","" "10:33:33.7566076 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","" "10:33:33.7566693 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7566884 AM","postgres.exe","1852","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "10:33:33.7566958 AM","postgres.exe","1852","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/28/2020 10:33:33 AM, LastAccessTime: 11/28/2020 10:33:33 AM, LastWriteTime: 11/28/2020 10:33:33 AM, ChangeTime: 11/28/2020 10:33:33 AM, FileAttributes: A, AllocationSize: 176, EndOfFile: 176, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x35d000000028bee, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "10:33:33.7567026 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","" "10:33:33.7567100 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","" "10:33:33.7567629 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7567825 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","" "10:33:33.7567899 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot\state","SUCCESS","" "10:33:33.7568417 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7568545 AM","postgres.exe","1852","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "10:33:33.7568622 AM","postgres.exe","1852","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/28/2020 10:33:33 AM, LastAccessTime: 11/28/2020 10:33:33 AM, LastWriteTime: 11/28/2020 10:33:33 AM, ChangeTime: 11/28/2020 10:33:33 AM, FileAttributes: D, AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: True, IndexNumber: 0x3a7000000028bec, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "10:33:33.7568696 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","" "10:33:33.7568758 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","" "10:33:33.7569284 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7569432 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","" "10:33:33.7569495 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot\otherdb_slot","SUCCESS","" "10:33:33.7570021 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7570149 AM","postgres.exe","1852","IRP_MJ_QUERY_VOLUME_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","Type: QueryInformationVolume, VolumeCreationTime: 7/28/2016 8:38:21 AM, VolumeSerialNumber: 8441-21CA, SupportsObjects: True, VolumeLabel: " "10:33:33.7570220 AM","postgres.exe","1852","IRP_MJ_QUERY_INFORMATION","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","BUFFER OVERFLOW","Type: QueryAllInformationFile, CreationTime: 11/28/2020 10:33:28 AM, LastAccessTime: 11/28/2020 10:33:33 AM, LastWriteTime: 11/28/2020 10:33:33 AM, ChangeTime: 11/28/2020 10:33:33 AM, FileAttributes: D, AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: True, IndexNumber: 0x18c0000000241f4, EaSize: 0, Access: Read EA, Read Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement: Word" "10:33:33.7570291 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","" "10:33:33.7570357 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","" "10:33:33.7570863 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:33:33.7571011 AM","postgres.exe","1852","IRP_MJ_CLEANUP","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","" "10:33:33.7571079 AM","postgres.exe","1852","IRP_MJ_CLOSE","C:\src\postgresql\src\test\recovery\tmp_check\t_006_logical_decoding_master_data\pgdata\pg_replslot","SUCCESS","" "10:33:33.7572069 AM","postgres.exe","1852","IRP_MJ_CREATE","C:\src\postgresql\tmp_install\usr\local\pgsql\lib\test_decoding","NAME NOT FOUND","Desired Access: Read EA, Read Attributes, Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" --------------C1D80E08413AF5D59149325C Content-Type: text/x-patch; charset=UTF-8; name="cygwin-open.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cygwin-open.patch" diff --git a/configure b/configure index 2f094716c7..cbb642c968 100755 --- a/configure +++ b/configure @@ -16414,6 +16414,12 @@ if test "$PORTNAME" = "cygwin"; then ;; esac + case " $LIBOBJS " in + *" open.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS open.$ac_objext" + ;; +esac + fi ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" diff --git a/configure.in b/configure.in index 854eba2d3a..8c6e48d2c2 100644 --- a/configure.in +++ b/configure.in @@ -1856,6 +1856,7 @@ fi # Cygwin needs only a bit of that if test "$PORTNAME" = "cygwin"; then AC_LIBOBJ(dirmod) + AC_LIBOBJ(open) fi AC_CHECK_FUNC(syslog, diff --git a/src/include/port.h b/src/include/port.h index ebcee1c55c..0db3beba0c 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -312,6 +312,20 @@ extern int gettimeofday(struct timeval *tp, struct timezone *tzp); #define closesocket close #endif /* WIN32 */ +#if defined(__CYGWIN__) + +/* + * open() and fopen() replacements to handle busy and + * "delete pending" files. + */ + +extern int cygwin_open(const char *, int,...); +extern FILE *cygwin_fopen(const char *, const char *); +#define open(a,b,c) cygwin_open(a,b,c) +#define fopen(a,b) cygwin_fopen(a,b) + +#endif + /* * On Windows, setvbuf() does not support _IOLBF mode, and interprets that * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) diff --git a/src/port/open.c b/src/port/open.c index 24af6f48bf..a7f9685d4b 100644 --- a/src/port/open.c +++ b/src/port/open.c @@ -11,7 +11,7 @@ *------------------------------------------------------------------------- */ -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) #ifndef FRONTEND #include "postgres.h" @@ -20,8 +20,12 @@ #endif #include +#include #include #include +#endif + +#if defined(WIN32) && !defined(__CYGWIN__) static int @@ -214,3 +218,125 @@ pgwin32_fopen(const char *fileName, const char *mode) } #endif + +#if defined(__CYGWIN__) + +/* + * Here, "open" means the platform's function not cygwin_open, + * and likewise for "fopen". + */ + +#undef open +#undef fopen + +int +cygwin_open(const char *fileName, int fileFlags,...) +{ + int fd; + int loops = 0; + + while ((fd = open(fileName, fileFlags)) == -1) { + /* + * EBUSY error (sharing violation or locking error) can occur when + * the file is renamed concurrently or can indicate antivirus, backup + * or similar software that's locking the file. Wait a bit and try + * again, giving up after 30 seconds. + */ + if (errno == EBUSY) { +#ifndef FRONTEND + if (loops == 50) + ereport(LOG, + (errmsg("could not open file \"%s\": %s", fileName, + _("sharing violation")), + errdetail("Continuing to retry for 30 seconds."), + errhint("You might have antivirus, backup, or similar software interfering with the database system."))); +#endif + + if (loops < 300) + { + pg_usleep(100000); + loops++; + continue; + } + } + /* + * EACCES is returned if the file is deleted but not yet + * gone (see pgwin32_open for details). + */ + if (errno == EACCES) { + if (loops < 10) + { + /* + * In case of conflict with a concurrent rename, the stat() + * function can return 0, so it can't be used here as + * in pgwin32_open(). + * But opening a directory doesn't lead to EACCES on cygwin, + * so unnecessary wait for 1 second will happen only in case + * of an actual file-permissions problem. + */ + pg_usleep(100000); + loops++; + continue; + } + } + return -1; + } + return fd; +} + +FILE * +cygwin_fopen(const char *fileName, const char *mode) +{ + FILE * fp; + int loops = 0; + while ((fp = fopen(fileName, mode)) == NULL) { + /* + * EBUSY error (sharing violation or locking error) can occur when + * the file is renamed concurrently or can indicate antivirus, backup + * or similar software that's locking the file. Wait a bit and try + * again, giving up after 30 seconds. + */ + if (errno == EBUSY) { +#ifndef FRONTEND + if (loops == 50) + ereport(LOG, + (errmsg("could not open file \"%s\": %s", fileName, + _("sharing violation")), + errdetail("Continuing to retry for 30 seconds."), + errhint("You might have antivirus, backup, or similar software interfering with the database system."))); +#endif + + if (loops < 300) + { + pg_usleep(100000); + loops++; + continue; + } + } + + /* + * EACCES is returned if the file is deleted but not yet + * gone (see pgwin32_open for details). + */ + if (errno == EACCES) { + if (loops < 10) + { + /* + * In case of conflict with a concurrent rename, the stat() + * function can return 0, so it can't be used here as + * in pgwin32_open(). + * But opening a directory doesn't lead to EACCES on cygwin, + * so unnecessary wait for 1 second will happen only in case + * of an actual file-permissions problem. + */ + pg_usleep(100000); + loops++; + continue; + } + } + return NULL; + } + return fp; +} + +#endif --------------C1D80E08413AF5D59149325C--