@Test
  public void test_Bug46619_Put_ValidateDataOnMember_PrimarySecondary_Datastore_CacheClosed() {
    member1.invoke(() -> {
      createCacheOnMember_DisableMovePrimary();
      FixedPartitionAttributes fpa1 = createFixedPartition(QUARTER_1, true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition(QUARTER_2, false, 3);
      createPartitionedRegion("Quarter", asList(fpa1, fpa2), 1, 40, 12,
          newQuarterPartitionResolver());
    });

    member2.invoke(() -> {
      createCacheOnMember_DisableMovePrimary();
      FixedPartitionAttributes fpa1 = createFixedPartition(QUARTER_2, true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition(QUARTER_3, false, 3);
      createPartitionedRegion("Quarter", asList(fpa1, fpa2), 1, 40, 12,
          newQuarterPartitionResolver());
    });

    member3.invoke(() -> {
      createCacheOnMember_DisableMovePrimary();
      FixedPartitionAttributes fpa1 = createFixedPartition(QUARTER_3, true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition(QUARTER_4, false, 3);
      createPartitionedRegion("Quarter", asList(fpa1, fpa2), 1, 40, 12,
          newQuarterPartitionResolver());
    });

    member4.invoke(() -> {
      createCacheOnMember_DisableMovePrimary();
      FixedPartitionAttributes fpa1 = createFixedPartition(QUARTER_4, true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition(QUARTER_1, false, 3);
      createPartitionedRegion("Quarter", asList(fpa1, fpa2), 1, 40, 12,
          newQuarterPartitionResolver());
    });

    member1.invoke(() -> putThroughDataStore("Quarter"));

    member1.invoke(() -> checkPrimarySecondaryData(QUARTER_1, false));
    member2.invoke(() -> checkPrimarySecondaryData(QUARTER_2, false));
    member3.invoke(() -> checkPrimarySecondaryData(QUARTER_3, false));
    member4.invoke(() -> checkPrimarySecondaryData(QUARTER_4, false));

    member1.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
    member2.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
    member3.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
    member4.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));

    member4.invoke(() -> cache.get().close());
    member2.invoke(() -> cache.get().close());

    Wait.pause(1000);

    member3.invoke(() -> checkPrimaryBucketsForQuarterAfterCacheClosed(6, 6));
    member1.invoke(() -> checkPrimaryBucketsForQuarterAfterCacheClosed(6, 6));

    member1.invoke(() -> putHAData("Quarter"));

    member4.invoke(() -> {
      createCacheOnMember_DisableMovePrimary();
      FixedPartitionAttributes fpa1 = createFixedPartition(QUARTER_4, true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition(QUARTER_1, false, 3);
      createPartitionedRegion("Quarter", asList(fpa1, fpa2), 1, 40, 12,
          newQuarterPartitionResolver());
    });

    member2.invoke(() -> {
      createCacheOnMember_DisableMovePrimary();
      FixedPartitionAttributes fpa1 = createFixedPartition(QUARTER_2, true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition(QUARTER_3, false, 3);
      createPartitionedRegion("Quarter", asList(fpa1, fpa2), 1, 40, 12,
          newQuarterPartitionResolver());
    });

    Wait.pause(1000);

    member1.invoke(() -> checkPrimarySecondaryData(QUARTER_1, true));
    member2.invoke(() -> checkPrimarySecondaryData(QUARTER_2, true));
    member3.invoke(() -> checkPrimarySecondaryData(QUARTER_3, true));
    member4.invoke(() -> checkPrimarySecondaryData(QUARTER_4, true));

    member1.invoke(() -> checkPrimaryBucketsForQuarter(6, 6));
    member2.invoke(() -> checkPrimaryBucketsForQuarter(6, 0));
    member3.invoke(() -> checkPrimaryBucketsForQuarter(6, 6));
    member4.invoke(() -> checkPrimaryBucketsForQuarter(6, 0));

    member4.invoke(this::doRebalance);

    Wait.pause(2000);

    member1.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
    member2.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
    member3.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
    member4.invoke(() -> checkPrimaryBucketsForQuarter(6, 3));
  }
Datastore = 4 Datastores Primary Secondary Member1 = Q1(0,1,2) Q2(3,4,5) Member2 = Q2(3,4,5)
Q3(6,7,8) Member3 = Q3(6,7,8) Q4(9,10,11) Member4 = Q4(9,10,11) Q1(0,1,2) Put happens for all
buckets Member 4 goes down, then either member1 or member2 holds primary for member4

<p>
Primary Secondary Member1 = Q1(0,1,2) Q2(3,4,5) Member2 = Q2(3,4,5) Q3(6,7,8) Member3 =
Q3(6,7,8), Q4(9,10,11)

<p>
Put happens considering Member3 is holding primary for Q4.

<p>
Member4 comes again, then Memeber4 should do the GII from member2 for buckets 6,7,8 and should
acquire primary status Datastores Primary Secondary Member1 = Q1(0,1,2) Q2(3,4,5) Member2 =
Q2(3,4,5) Q3(6,7,8) Member3 = Q3(6,7,8) Q4(9,10,11) Member4 = Q4(9,10,11) Q1(0,1,2)
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java