[
https://issues.apache.org/jira/browse/GEODE-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16254301#comment-16254301
]
Darrel Schneider commented on GEODE-3949:
-----------------------------------------
I think this has more to do with how region creation gets registered with the
management layer. I think that is done in an async fashion. So I'm changing the
component to management. If this happened with a client or peer using java apis
then it would be a different issue. I think the race is when gfsh will be able
to detect that a region exists.
> gfsh> put fails immediately after server startup
> ------------------------------------------------
>
> Key: GEODE-3949
> URL: https://issues.apache.org/jira/browse/GEODE-3949
> Project: Geode
> Issue Type: Bug
> Components: management
> Affects Versions: 1.3.0
> Reporter: Wes Williams
>
> A bug was introduced since GemFire 8.2 where regions are not available
> immediately after server startup.
> *GIVEN* a server that just started with a region that is defined in
> cache.xml,
> *THEN* following "put" fails when run from a linux bash script:
> gfsh <<!
> start locator --name=locator --properties-file=config/locator.properties
> --port=10334 --J=-Xms256m --J=-Xmx256m
> start server --name=server1 --locators=localhost[10334] --J=-Xms512m
> --J=-Xmx512m --cache-xml-file=config/cache.xml
> --properties-file=config/gemfire.properties
> put --key='1' --value='A' --region=departments; *{color:red}<== FAIL
> {color}*
> Result : false
> Message : Region <departments> not found in any of the members
> *{color:red}<== NOT FOUND?? {color}*
> gfsh>list regions;
> List of regions
> ---------------
> departments *{color:red}<== BUT IT IS FOUND {color}*
> exit;
> !
> However, inserting a 1-second pause after server startup, the put succeeds:
> {{gfsh <<!
> start locator --name=locator --properties-file=config/locator.properties
> --port=$LOCATOR_PORT --J=-Xms256m --J=-Xmx256m
> configure pdx --portable-auto-serializable-classes=".*"
> start server --name=server1 --locators=localhost[10334] --J=-Xms512m
> --J=-Xmx512m --cache-xml-file=config/cache.xml
> --properties-file=config/gemfire.properties
> exit;
> !
> sleep 1
> gfsh <<!
> connect
> put --key='1' --value='A' --region=departments;
> }}
> *TO REPRODUCE:*
> *Run this with GemFire 9.1.x:*
> {{#!/bin/bash
> rm locator/*.dat
> gfsh <<!
> start locator --name=locator --J=-Xms256m --J=-Xmx256m
> start server --name=server1 --locators=localhost[10334] --J=-Xms512m
> --J=-Xmx512m --cache-xml-file=cache.xml
> put --key='1' --value='A' --region=departments;
> list regions
> exit;
> !}}
> *Here's a basic cache.xml:*
> {{<?xml version="1.0"?>
> <!DOCTYPE cache PUBLIC
> "-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN"
> "http://www.gemstone.com/dtd/cache8_0.dtd">
> <cache>
> <region name="departments">
> <region-attributes data-policy="replicate">
> </region-attributes>
> </region>
> </cache>}}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)