pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
BUG #16750: VACUUM sporadically fails to access pgstat on Cygwin 2+ messages / 2 participants [nested] [flat]
* BUG #16750: VACUUM sporadically fails to access pgstat on Cygwin @ 2020-11-29 05:00 PG Bug reporting form <noreply@postgresql.org> 0 siblings, 1 reply; 2+ messages in thread From: PG Bug reporting form @ 2020-11-29 05:00 UTC (permalink / raw) To: pgsql-bugs@lists.postgresql.org; +Cc: exclusion@gmail.com The following bug has been logged on the website: Bug reference: 16750 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 12.5 Operating system: Windows (Cygwin) Description: As the buildfarm shows ([1], [2], [3]), VACUUM (and CREATE INDEX) from time to time can produce the following warnings (that leads to test failures): https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=lorikeet&dt=2020-09-07%2020%3A31%3... https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet&dt=2019-10-27%2009%3A36%3A07 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. [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet&dt=2020-06-04%2003%3A51%3A45 [2] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=lorikeet&dt=2020-08-17%2008%3A28%3... [3] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=lorikeet&dt=2020-09-02%2008%3A28%3... ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #16750: VACUUM sporadically fails to access pgstat on Cygwin @ 2020-11-29 06:00 Alexander Lakhin <exclusion@gmail.com> parent: PG Bug reporting form <noreply@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Alexander Lakhin @ 2020-11-29 06:00 UTC (permalink / raw) To: pgsql-bugs@lists.postgresql.org 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=885ca375ac2b9afaa8fb... [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 Attachments:Logfile-SharingViolation1.CSV (text/csv, 23.4K) download
"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",""Logfile-006_logical_decoding.CSV (text/csv, 9.1K) download
"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"^ permalink raw reply [nested|flat] 2+ messages in threadcygwin-open.patch (text/x-patch, 5.0K) download
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 <fcntl.h> +#include <unistd.h> #include <assert.h> #include <sys/stat.h> +#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
end of thread, other threads:[~2020-11-29 06:00 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-11-29 05:00 BUG #16750: VACUUM sporadically fails to access pgstat on Cygwin PG Bug reporting form <noreply@postgresql.org> 2020-11-29 06:00 ` Alexander Lakhin <exclusion@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox