Articles in this section

How to change data-size config in a running cluster?

Context

The data-size setting was introduced in Aerospike server 7.0. It specifies the total amount of memory allocated in Shared Memory for the namespace's eight virtual devices. This size is split into 8 stripes. The stripes appear individually in the logs. (ie:  stripe-3.0xad002003 where the 0xad hexadecimal prefix helps identify the shared memory segments key for the stripes)

 
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-3.0xad002003: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-2.0xad002002: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-5.0xad002005: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-4.0xad002004: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-7.0xad002007: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-6.0xad002006: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-1.0xad002001: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0)
Jan 13 2024 13:01:29 GMT: INFO (drv-mem): (drv_mem.c:3161) {bar} stripe-0.0xad002000: used-bytes 0 free-wblocks 15 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0

When changing the size of the data-size setting on a pre-existing config, the server will fail to start if the shared memory has not been released prior to starting the server with the new stripe size.
 
CRITICAL (drv-mem): (drv_mem.c:1098) existing memory stripe size differs from config

The solution is to either clear the shared memory with a tool like ipcrm or reboot the machine.
 

Method

Let us explore the option to identify and remove the pre-existing allocated stripes.

1) Verify stripes segment by running following as root:
 
 ipcs -m | grep 0xad

output:
 
root@mycluster-1:/# ipcs -m | grep 0xad
0xad002000 3          root       666        536870912  0                       
0xad002001 4          root       666        536870912  0                       
0xad002002 5          root       666        536870912  0                       
0xad002003 6          root       666        536870912  0                       
0xad002004 7          root       666        536870912  0                       
0xad002005 8          root       666        536870912  0                       
0xad002006 9          root       666        536870912  0                       
0xad002007 10         root       666        536870912  0

2) Delete the stripes segments usign a tool like ipcrm:

 

Notes

ipcs;for i in `ipcs -m | grep 0xad|cut -d ' ' -f 2|tr '\n' ' '` ;do ipcrm shm  $i; done

 

output:
 
------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0xad002000 3          root       666        536870912  0                       
0xad002001 4          root       666        536870912  0                       
0xad002002 5          root       666        536870912  0                       
0xad002003 6          root       666        536870912  0                       
0xad002004 7          root       666        536870912  0                       
0xad002005 8          root       666        536870912  0                       
0xad002006 9          root       666        536870912  0                       
0xad002007 10         root       666        536870912  0                       
0xae001100 32         root       666        1073741824 0                       
0xae002100 33         root       666        1073741824 0                       
0xa2001100 34         root       666        1073741824 0                       

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     

resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted

4) Verify deletion with ipcs:
ipcs -m
output:
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0xae001100 32         root       666        1073741824 0                       
0xae002100 33         root       666        1073741824 0                       
0xa2001100 34         root       666        1073741824 0                


5) Restart the Aerospike Service

Applies To Earliest Version

Current Version

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful