Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7764

LastModifiedTime not updated for Destroy/Remove

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: regions, statistics
    • Labels:
      None

      Description

      This issue was raised through this StackOverflow question, basically the `lastModifiedTime` is not updated after a `destroy`/`remove` operation.
      The following test can be used to consistently reproduce the issue:

      @Category(OQLQueryTest.class)
      @RunWith(JUnitParamsRunner.class)
      public class StackOverflowTests {
        private static final String REGION_NAME = "testRegion";
      
        @Rule
        public ServerStarterRule server = new ServerStarterRule().withJMXManager().withAutoStart();
      
        private Region<String, String> setUpRegion(RegionShortcut regionShortcut) {
          return server.getCache().<String, String>createRegionFactory(regionShortcut)
              .setStatisticsEnabled(true)
              .create(REGION_NAME);
        }
      
        @Test
        @Parameters({"REPLICATE", "PARTITION"})
        public void lastModifiedTimeForRemove(RegionShortcut regionShortcut) {
          Region<String, String> region = setUpRegion(regionShortcut);
          long initialLastModifiedTime = region.getStatistics().getLastModifiedTime();
      
          region.put("key1", "value1");
          await()
              .atMost(1, TimeUnit.MINUTES)
              .untilAsserted(() -> assertThat(region.getStatistics().getLastModifiedTime()).isGreaterThan(initialLastModifiedTime));
          long lLastModifiedTimeAfterPut = region.getStatistics().getLastModifiedTime();
      
          region.remove("key1");
          await()
              .atMost(1, TimeUnit.MINUTES)
              .untilAsserted(() -> assertThat(region.getStatistics().getLastModifiedTime()).isGreaterThan(lLastModifiedTimeAfterPut));
        }
      
        @Test
        @Parameters({"REPLICATE", "PARTITION"})
        public void lastModifiedTimeForDestroy(RegionShortcut regionShortcut) {
          Region<String, String> region = setUpRegion(regionShortcut);
          long initialLastModifiedTime = region.getStatistics().getLastModifiedTime();
      
          region.put("key1", "value1");
          await()
              .atMost(1, TimeUnit.MINUTES)
              .untilAsserted(() -> assertThat(region.getStatistics().getLastModifiedTime()).isGreaterThan(initialLastModifiedTime));
          long lLastModifiedTimeAfterPut = region.getStatistics().getLastModifiedTime();
      
          region.destroy("key1");
          await()
              .atMost(1, TimeUnit.MINUTES)
              .untilAsserted(() -> assertThat(region.getStatistics().getLastModifiedTime()).isGreaterThan(lLastModifiedTimeAfterPut));
        }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jjramos Juan Ramos
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: