File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,8 @@ MtmUpdateLsnMapping(int node_id, lsn_t end_lsn)
256
256
lsn_t local_flush = GetFlushRecPtr ();
257
257
MemoryContext old_context = MemoryContextSwitchTo (TopMemoryContext );
258
258
259
+ Assert (MtmIsReceiver && !MtmIsPoolWorker );
260
+
259
261
if (end_lsn != INVALID_LSN )
260
262
{
261
263
/* Track commit lsn */
@@ -266,13 +268,16 @@ MtmUpdateLsnMapping(int node_id, lsn_t end_lsn)
266
268
dlist_push_tail (& MtmLsnMapping , & flushpos -> node );
267
269
}
268
270
271
+ // XXX: now we use this only in receiver, but in case of recovery
272
+ // one receiver can set flushPos for several nodes
269
273
MtmLock (LW_EXCLUSIVE );
270
274
dlist_foreach_modify (iter , & MtmLsnMapping )
271
275
{
272
276
flushpos = dlist_container (MtmFlushPosition , node , iter .cur );
273
277
if (flushpos -> local_end <= local_flush )
274
278
{
275
- if (Mtm -> nodes [node_id - 1 ].flushPos < flushpos -> remote_end )
279
+ // XXX: clean on restart?
280
+ if (Mtm -> nodes [node_id - 1 ].flushPos < flushpos -> remote_end && node_id == flushpos -> node_id )
276
281
Mtm -> nodes [node_id - 1 ].flushPos = flushpos -> remote_end ;
277
282
dlist_delete (iter .cur );
278
283
pfree (flushpos );
You can’t perform that action at this time.
0 commit comments