@@ -566,7 +566,7 @@ Series::flushFileBased( IterationsContainer && iterationsToFlush )
566566 // file corresponding with the iteration has previously been
567567 // closed and fully flushed
568568 // verify that there have been no further accesses
569- if ( ! i.second .verifyClosed () )
569+ if ( i.second .dirtyRecursive () )
570570 {
571571 throw std::runtime_error (
572572 " [Series] Detected illegal access to iteration that "
@@ -599,7 +599,7 @@ Series::flushFileBased( IterationsContainer && iterationsToFlush )
599599 " [Series] Closed iteration has not been written. This "
600600 " is an internal error." );
601601 }
602- if ( ! i.second .verifyClosed () )
602+ if ( i.second .dirtyRecursive () )
603603 {
604604 throw std::runtime_error (
605605 " [Series] Detected illegal access to iteration that "
@@ -657,7 +657,7 @@ Series::flushGroupBased( IterationsContainer && iterationsToFlush )
657657 // file corresponding with the iteration has previously been
658658 // closed and fully flushed
659659 // verify that there have been no further accesses
660- if ( ! i.second .verifyClosed () )
660+ if ( i.second .dirtyRecursive () )
661661 {
662662 throw std::runtime_error (
663663 " [Series] Illegal access to iteration " +
@@ -667,6 +667,12 @@ Series::flushGroupBased( IterationsContainer && iterationsToFlush )
667667 continue ;
668668 }
669669 i.second .flush ();
670+ if ( *i.second .m_closed == Iteration::CloseStatus::ClosedInFrontend )
671+ {
672+ // the iteration has no dedicated file in group-based mode
673+ *i.second .m_closed = Iteration::CloseStatus::ClosedInBackend;
674+ }
675+ IOHandler->flush ();
670676 }
671677 else
672678 {
@@ -692,7 +698,7 @@ Series::flushGroupBased( IterationsContainer && iterationsToFlush )
692698 " [Series] Closed iteration has not been written. This "
693699 " is an internal error." );
694700 }
695- if ( ! i.second .verifyClosed () )
701+ if ( i.second .dirtyRecursive () )
696702 {
697703 throw std::runtime_error (
698704 " [Series] Illegal access to iteration " +
@@ -707,9 +713,15 @@ Series::flushGroupBased( IterationsContainer && iterationsToFlush )
707713 i.second .parent = getWritable (&iterations);
708714 }
709715 i.second .flushGroupBased (i.first );
716+ if ( *i.second .m_closed == Iteration::CloseStatus::ClosedInFrontend )
717+ {
718+ // the iteration has no dedicated file in group-based mode
719+ *i.second .m_closed = Iteration::CloseStatus::ClosedInBackend;
720+ }
710721 }
711722
712723 flushAttributes ();
724+ IOHandler->flush ();
713725 }
714726}
715727
0 commit comments