~ubuntu-branches/ubuntu/utopic/postgresql-9.1/utopic

« back to all changes in this revision

Viewing changes to src/backend/port/win32_latch.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-09-25 05:40:23 UTC
  • mfrom: (1.2.1)
  • Revision ID: package-import@ubuntu.com-20120925054023-lv75ptpdzvjdhkbw
Tags: 9.1.6-1
* Urgency medium because of data loss bug fix.
* New upstream bug fix release:
  - Fix persistence marking of shared buffers during WAL replay.
    This mistake can result in buffers not being written out during
    checkpoints, resulting in data corruption if the server later
    crashes without ever having written those buffers. Corruption can
    occur on any server following crash recovery, but it is
    significantly more likely to occur on standby slave servers since
    those perform much more WAL replay. There is a low probability of
    corruption of btree and GIN indexes. There is a much higher
    probability of corruption of table "visibility maps". Fortunately,
    visibility maps are non-critical data in 9.1, so the worst
    consequence of such corruption in 9.1 installations is transient
    inefficiency of vacuuming. Table data proper cannot be corrupted by
    this bug.
    While no index corruption due to this bug is known to have occurred
    in the field, as a precautionary measure it is recommended that
    production installations "REINDEX" all btree and GIN indexes at a
    convenient time after upgrading to 9.1.6.
    Also, if you intend to do an in-place upgrade to 9.2.X, before
    doing so it is recommended to perform a "VACUUM" of all tables
    while having vacuum_freeze_table_age set to zero. This will ensure
    that any lingering wrong data in the visibility maps is corrected
    before 9.2.X can depend on it. vacuum_cost_delay can be adjusted to
    reduce the performance impact of vacuuming, while causing it to
    take longer to finish.
  - See HISTORY/changelog.gz for the other bug fixes.
* debian/rules: Compress all binaries with xz. Thanks Cyril Brulebois!
  (Closes: #688678)

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
        numevents = 2;
109
109
        if (sock != PGINVALID_SOCKET && (forRead || forWrite))
110
110
        {
 
111
                /* Need an event object to represent events on the socket */
111
112
                int                     flags = 0;
112
113
 
113
114
                if (forRead)
114
 
                        flags |= FD_READ;
 
115
                        flags |= (FD_READ | FD_CLOSE);
115
116
                if (forWrite)
116
117
                        flags |= FD_WRITE;
117
118
 
154
155
                        Assert(sock != PGINVALID_SOCKET);
155
156
 
156
157
                        ZeroMemory(&resEvents, sizeof(resEvents));
157
 
                        if (WSAEnumNetworkEvents(sock, sockevent, &resEvents) == SOCKET_ERROR)
 
158
                        if (WSAEnumNetworkEvents(sock, sockevent, &resEvents) != 0)
158
159
                                ereport(FATAL,
159
 
                                                (errmsg_internal("failed to enumerate network events: %i", (int) GetLastError())));
160
 
 
161
 
                        if ((forRead && resEvents.lNetworkEvents & FD_READ) ||
 
160
                                                (errmsg_internal("failed to enumerate network events: %i", (int) WSAGetLastError())));
 
161
                        if ((forRead && resEvents.lNetworkEvents & (FD_READ | FD_CLOSE)) ||
162
162
                                (forWrite && resEvents.lNetworkEvents & FD_WRITE))
163
163
                                result = 2;
164
164
                        break;
167
167
                        elog(ERROR, "unexpected return code from WaitForMultipleObjects(): %d", (int) rc);
168
168
        }
169
169
 
170
 
        /* Clean up the handle we created for the socket */
171
 
        if (sock != PGINVALID_SOCKET && (forRead || forWrite))
 
170
        /* Clean up the event object we created for the socket */
 
171
        if (sockevent != WSA_INVALID_EVENT)
172
172
        {
173
 
                WSAEventSelect(sock, sockevent, 0);
 
173
                WSAEventSelect(sock, NULL, 0);
174
174
                WSACloseEvent(sockevent);
175
175
        }
176
176