It’s persisting data after reboot and able to retrieve inserted records from cache. Only problem is, cache.size getting reset to zero after first restart of the cluster.
Please find output of requested commands and code snippet for getting cache.size . ############################################ [tibusr@******~]$ df Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 7812268 0 7812268 0% /dev tmpfs 7823392 4 7823388 1% /dev/shm tmpfs 7823392 795764 7027628 11% /run tmpfs 7823392 0 7823392 0% /sys/fs/cgroup /dev/mapper/vg_os-lv_root 103080888 47604952 50216672 49% / /dev/sda2 999320 106456 824052 12% /boot /dev/mapper/vg_os-lv_app 103080888 22497672 75323952 23% /app tmpfs 1564680 0 1564680 0% /run/user/1002 tmpfs 1564680 0 1564680 0% /run/user/7071 [tibusr@****** ~]$ lsattr /app -------------e-- /app/snapshots1 -------------e-- /app/datastore1 -------------e-- /app/logs [tibusr@******~]$ lsattr /app/datastore1 -------------e-- /app/datastore1/archive -------------e-- /app/datastore1/data -------------e-- /app/datastore1/wal -------------e-- /app/datastore1/metadataWorkDir [tibusr@******~]$ ###################################### JAVA CODE Snippet to get cache size ######################################## /** * */ package com.jio.digitalapi.edif.util.operations; import java.util.Arrays; import java.util.Properties; import java.util.UUID; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import com.jio.digitalapi.jtl.edif.model.JtlCustomer; import javax.swing.*; /** * @author Gangaiah Gundeboina * */ public class CacheSizes { public static <K, V> void main(String[] args) { String igniteNodeIpAddress = "IPADDRESS"; String igniteInstanceName = null; try { String[] ipAddrArray = igniteNodeIpAddress.split(",", -1); System.setProperty("java.net.preferIPv4Stack", "true"); IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setPeerClassLoadingEnabled(true); cfg.setClientMode(true); String random = (UUID.randomUUID().getMostSignificantBits() + "").toString().replace("-", ""); String igniteFullInstaneName = igniteInstanceName + random; cfg.setIgniteInstanceName(igniteFullInstaneName); cfg.setDiscoverySpi((new TcpDiscoverySpi().setJoinTimeout(2400000) .setIpFinder((new TcpDiscoveryVmIpFinder()).setAddresses(Arrays.asList(ipAddrArray))))); Ignite ignite = Ignition.start(cfg); IgniteCache<String, JtlCustomer> cache = ignite.cache("JtlCustomerCache"); System.out.println("PRIMARY:"+Integer.valueOf(cache.size(new CachePeekMode[]{CachePeekMode.PRIMARY})).toString()); } catch (Exception e) { e.printStackTrace(); System.exit(0); } System.exit(0); } } ############################################################## From: Gianluca Bonetti <gianluca.bone...@gmail.com> Sent: Monday, May 15, 2023 5:02 PM To: user@ignite.apache.org; Krishna Mulumudi <krishna.mulum...@ril.com> Cc: Gangaiah Gundeboina (Consultant) <gangaiah.gundebo...@ril.com> Subject: [External]Re: Re: Cache size getting zero after first restart of server node in 2.13 version Caution: The e-mail below is from an external source. Please do not open attachments or click links unless this email comes from a known sender and you know the content is safe. Hello I can make the same setup working on my computer. What I mean is that when you write to the cache, you should see some files being created in storage and these should persist across software reboots. It is still possible there are some configuration settings in your Java code, and also how the cache is being fed is undisclosed. Also, are you running inside Kubernetes? Can we have the output of: - mount - df - lsattr /app - lsattr /app/datastore1 - lsattr /app/datastore1 Cheers Gianluca On Mon, 15 May 2023 at 11:32, Krishna.Mulumudi.ril.com<http://Krishna.Mulumudi.ril.com> via user <user@ignite.apache.org<mailto:user@ignite.apache.org>> wrote: After first restart of the cluster, Data is there and able retrieve from get calls but getting cache size zero, it's not retaining value. Able to replicate the issue with single server node also. 1. start server node 2. activate cluster. 3. write few records to cache. 4. restart the cluster Below are inline comments for requested info, Do these paths exist? -- Yes What are the permission flags for these three paths? (owner, group, permissions) -- drwxrwxr-x. Are you running the process by a user who has owner or group permission? -- runing with a user (tibusr) Any content in these directories from previous executions? -- No, we have setup new cluster and then inserted few records and then restarted the cluster. Any particular warning or failure description in the log files? -- could not see any warnings/errors Please find directories info for above requested info, ##################################################################### [tibusr@******* ~]$ cd /app/Ignite/scripts [tibusr@******* scripts]$ cat config.properties nodeIpAddresses=*******:47500 maxSize=#{10L * 1024 * 1024 * 1024} checkpointPageBufferSize=#{24L * 1024 * 1024 } pageSize=#{4 * 1024} #pageSize=#{16 * 1024} storagePath=/app/datastore1/data walMode=BACKGROUND walFlushFrequency=30000 rebalanceThreadPoolSize=4 rebalanceThrottle=100 rebalanceBatchSize=#{16 * 1024 * 1024} walPath=/app/datastore1/wal metadataWorkDir=/app/datastore1/metadataWorkDir walArchivePath=/app/datastore1/archive #IGNITE_LOG4J2=/app/Ignite/scripts/ignite-log4j.xml IGNITE_LOG4J2=/app/Ignite/scripts/ignite-log4j2.xml IGNITE_INSTANCE_NAME=EDIF_IOT_ST snapshotsDirPath=/app/snapshots1/ [tibusr@******* scripts]$ cd /app/ [tibusr@******* app]$ ls -ltr total 27552 drwx------. 2 tibusr tibusr 16384 Apr 6 2018 lost+found drwxrwxr-x. 2 tibusr tibusr 4096 May 11 17:11 snapshots1 drwxrwxr-x. 3 tibusr tibusr 4096 May 13 15:34 logs drwxrwxr-x. 6 tibusr tibusr 4096 May 13 17:02 datastore1 [tibusr@******* app]$ cd datastore1 [tibusr@******* datastore1]$ ls -ltr total 16 drwxrwxr-x. 3 tibusr tibusr 4096 May 13 17:02 data drwxrwxr-x. 4 tibusr tibusr 4096 May 13 17:02 metadataWorkDir drwxrwxr-x. 3 tibusr tibusr 4096 May 13 17:02 wal drwxrwxr-x. 3 tibusr tibusr 4096 May 13 17:02 archive [tibusr@******* datastore1]$ ####################################################################### And also please find attached server log. From: Krishna Mulumudi Sent: Friday, May 12, 2023 11:41 PM To: user@ignite.apache.org<mailto:user@ignite.apache.org> Subject: RE: Re: Cache size getting zero after first restart of server node in 2.13 version Hi Gianluca Bonetti, Please find below details CACHE CONFIGURATION : <property name="cacheConfiguration"> <list> <bean class="org.apache.ignite.configuration.CacheConfiguration" parent="cache-template"> <property name="name" value="JtlMapCustCache" /> <property name="cacheMode" value="PARTITIONED" /> <property name="atomicityMode" value="ATOMIC" /> <property name="backups" value="1" /> <property name="statisticsEnabled" value="true" /> <property name="queryEntities"> <list> <bean class="org.apache.ignite.cache.QueryEntity"> <property name="keyType" value="com.jio.digitalapi.jtl.edif.model.JtlMapCustKey" /> <property name="valueType" va SERVER CONFIGURATION : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd<http://www.springframework.org/schema/beans%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%20http:/www.springframework.org/schema/beans/spring-beans.xsd%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%20http:/www.springframework.org/schema/util%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%20http:/www.springframework.org/schema/util/spring-util.xsd>"> <!-- Load external properties file. --> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="file:${PROPERTY_FILE_PATH}" /> </bean> <bean class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="igniteInstanceName" value="${IGNITE_INSTANCE_NAME}" /> <property name="peerClassLoadingEnabled" value="true"/> <property name="metricsLogFrequency" value="0" /> <property name="failureDetectionTimeout" value="60000" /> <property name="clientFailureDetectionTimeout" value="120000" /> <property name="networkTimeout" value="60000" /> <property name="workDirectory" value="${metadataWorkDir}"/> <property name="snapshotPath" value="${snapshotsDirPath}"/> <!--<property name="authenticationEnabled" value="true"/>--> <!-- <property name="failureHandler"> <bean class="org.apache.ignite.failure.NoOpFailureHandler"/> </property> --> <!-- <property name="includeEventTypes"> <list> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/> </list> </property> --> <property name="rebalanceThreadPoolSize" value="${rebalanceThreadPoolSize}"/> <!--<property name="clientConnectorConfiguration"> <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration" > <property name="jdbcEnabled" value="false"/> </bean> </property>--> <property name="gridLogger"> <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger"> <constructor-arg type="java.lang.String" value="${IGNITE_SCRIPT}/ignite-log4j2.xml" /> </bean> </property> <property name="dataStorageConfiguration"> <bean class="org.apache.ignite.configuration.DataStorageConfiguration"> <property name="defaultDataRegionConfiguration"> <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> <property name="metricsEnabled" value="true"/> <property name="persistenceEnabled" value="true" /> <!--<property name="maxSize" value="#{10L * 1024 * 1024 * 1024}"/> --> <property name="maxSize" value="${maxSize}" /> <!-- Increasing the buffer size to 4 GB. --> <property name="checkpointPageBufferSize" value="${checkpointPageBufferSize}" /> </bean> </property> <property name="storagePath" value="${storagePath}" /> <property name="walPath" value="${walPath}" /> <property name="walArchivePath" value="${walArchivePath}" /> <!--<property name="walMode" value="LOG_ONLY" />--> <property name="walMode" value="${walMode}" /> <property name="walFlushFrequency" value="${walFlushFrequency}"/> <property name="pageSize" value="${pageSize}" /> <!-- Enable write throttling. --> <property name="writeThrottlingEnabled" value="true" /> <property name="walHistorySize" value="1" /> <property name="metricsEnabled" value="true"/> <property name="defaultWarmUpConfiguration"> <bean class="org.apache.ignite.configuration.LoadAllWarmUpConfiguration"/> </property> </bean> </property> <property name="discoverySpi"> <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> <property name="ipFinder"> <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> <property name="addresses"> <bean class="org.springframework.util.StringUtils" factory-method="commaDelimitedListToSet"> <constructor-arg type="java.lang.String" value="${nodeIpAddresses}" /> </bean> </property> </bean> </property> </bean> </property> <property name="communicationSpi"> <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi"> <property name="socketWriteTimeout" value="60000"/> </bean> </property> </bean> </beans> Regards, Krishna Mulumudi On 2023/05/12 08:14:25 Gianluca Bonetti wrote: > Hello > > Not enough information, you didn't provide the current full configuration > nor a reproducible code test case. > > Cheers > Gianluca > > On Fri, 12 May 2023 at 09:07, Ganguly Gundeboina > <ga...@gmail.com<mailto:ga...@gmail.com>> > wrote: > > > Hi, > > > > We recently setup the 2.13 ignite cluster having three server nodes and > > enabled write services to write the records to the cluster. > > > > After few days, want to restart the cluster as part of maintenance > > activity. After restart all cache sizes showing zero even though data is > > there and getting retrieved. > > > > Below one used to get the cache size, > > cache.size(new CachePeekMode[]{Cache.PeekMode.PRIMARY}) > > > > cache size is important to validate the data during maintenance. > > > > Replication steps: > > 1. setup cluster 2.13 > > 2. insert few records in any cache. > > 3. restart the cluster. > > > > Same issue not observed in 2.11 and 2.7.6 versions. > > > > Regards, > > Ganguly > > > Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows "Confidentiality Warning: This message and any attachments are intended only for the use of the intended recipient(s), are confidential and may be privileged. If you are not the intended recipient, you are hereby notified that any review, re-transmission, conversion to hard copy, copying, circulation or other use of this message and any attachments is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this message and any attachments from your system. Virus Warning: Although the company has taken reasonable precautions to ensure no viruses are present in this email. The company cannot accept responsibility for any loss or damage arising from the use of this email or attachment." "Confidentiality Warning: This message and any attachments are intended only for the use of the intended recipient(s). are confidential and may be privileged. If you are not the intended recipient. you are hereby notified that any review. re-transmission. conversion to hard copy. copying. circulation or other use of this message and any attachments is strictly prohibited. If you are not the intended recipient. please notify the sender immediately by return email. and delete this message and any attachments from your system. Virus Warning: Although the company has taken reasonable precautions to ensure no viruses are present in this email. The company cannot accept responsibility for any loss or damage arising from the use of this email or attachment."