Bug 879570

Summary: StateChunk with isLastChunk=true not sent when all entries are sent ahead
Product: [JBoss] JBoss Data Grid 6 Reporter: Radim Vansa <rvansa>
Component: InfinispanAssignee: Tristan Tarrant <ttarrant>
Status: VERIFIED --- QA Contact: Martin Gencur <mgencur>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0CC: jdg-bugs, rhusar
Target Milestone: ER5   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Radim Vansa 2012-11-23 11:03:17 UTC
During a state transfer the entries are sent batched to chunks. However, if all entries are sent in the non-last chunk, the list in entriesBySegment.get(segmentId) is empty. The code for sending last chunks is following:

OutboundTransferTask.sendEntries(...)
...
if (isLast) {
         for (int segmentId : segments) {
            List<InternalCacheEntry> entries = entriesBySegment.get(segmentId);
            if (entries == null) {
               chunks.add(new StateChunk(segmentId, InfinispanCollections.<InternalCacheEntry>emptyList(), true));
            }
         }
      }
...

See that the check is entries == null but not entries.isEmpty().
This causes to leave some segments unfinished, never finishing the state transfer.

Comment 1 JBoss JIRA Server 2012-12-04 11:53:58 UTC
Mircea Markus <mmarkus> made a comment on jira ISPN-2546

[~rvansa] very good bug description!