Skip to content

Instantly share code, notes, and snippets.

From RADOS to REDIS

Bucket notifications are important building block for many use cases. And persistent bucket notifications in particular, as they let the system overcome broker outages. However, since the persistent notifications are backed with a RADOS queue, they have a cost. Both in the extra load on the RADOS cluster, and with the inability to operate in environemnts where there is no RADOS backend. In this project, we would like to implement persistent bucket notifications in the RADOS Gateway using a Redis Queue. Combined with the "zipper" project we would be able to enjoy bucket notifications with backends like posix, dbstore, daos etc.

Lunar Time

Lua scripts on the RADOS Gateway are powerful, so, in the meantime we only allow admins to add them to the RADOS Gatewway. Before we open this possibility to users, we want to add several protection layers to prevent from careless users to take down the system.

Basic Case

  • start cluser with realm (single zone):
OSD=1 MON=1 MDS=0 MGR=0 ../src/test/rgw/test-rgw-multisite.sh 1
  • disable v2 topics:
bin/radosgw-admin -c run/c1/ceph.conf zonegroup modify --disable-feature=notification_v2
bin/radosgw-admin -c run/c1/ceph.conf period update
bin/radosgw-admin -c run/c1/ceph.conf period commit
@yuvalif
yuvalif / get_teuthology_logs.sh
Last active February 5, 2024 10:59
get logs from teuthology and grep for errors
#!/bin/bash
if [ "$#" -eq 2 ]; then
name=$1
id=$2
cluster="ceph"
endloop=0
elif [ "$#" -eq 3 ]; then
name=$1
id=$2
  • verify machine has extra disks. e.g.
$ lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 893.8G  0 disk 
__sda1    8:1    0 893.8G  0 part /
nvme0n1 259:0    0   1.5T  0 disk 
nvme3n1 259:1    0   1.5T  0 disk 
nvme1n1 259:2    0   1.5T  0 disk 
nvme5n1 259:3    0   1.5T  0 disk 
@yuvalif
yuvalif / rgw_multisite_tests.md
Last active December 18, 2023 07:21
Ceph RGW multisite tests suite

Running Tests Locally

  • you run the tests locally from your "build" directory in your test environment
  • then you need to add a "test_multi.conf" file:
[DEFAULT]
num_zonegroups=1
num_zones=1
num_ps_zones=0
gateways_per_zone=1

Setup

  • start cluster using vstart
  • create bucket and log bucket:
aws --endpoint-url http://localhost:8000 s3 mb s3://fish
aws --endpoint-url http://localhost:8000 s3 mb s3://fish-log
  • create bucket logging conf:
aws --endpoint-url http://localhost:8000 s3api put-bucket-logging --bucket fish \
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: *****************************************                                                                                                                                     [89/1934]
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: op was: create_bucket              
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: header: CONTENT_LENGTH = 0 
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: header: HTTP_ACCEPT_ENCODING = identity
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: header: HTTP_AMZ_SDK_INVOCATION_ID = 515f92f7-28c4-40ce-82c5-85ae32b289f5
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: header: HTTP_AMZ_SDK_REQUEST = attempt=1
2023-11-27T14:18:57.001+0000 7f34bf328700 20 Lua INFO: header: HTTP_AUTHORIZATION = AWS4-HMAC-SHA256 Credential=0555b35654ad1656d804/20231127/default/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=e697901ed
454198d69dcb4fe5828eb00f4435917bd8dfd1642a958801

Fedora28-32

Current status:

df -h

Find large files in the system:

sudo find / -type f -size +1000M -exec ls -lh {} \;
sudo dnf -y debuginfo-install ceph-radosgw-18.0.0-7437.gd67340ee.el9.x86_64
sudo gdb /usr/bin/radosgw -p $(pgrep radosgw)
while :; do pgrep -a radosgw; sleep 1; done
archive_path: /home/<username>/archive_dir
verbose: true
interactive-on-error: true
## wait_for_scrub being false makes locked runs go a lot faster
wait_for_scrub: false
owner: scheduled_<username>@teuthology
kernel:
kdb: true
sha1: distro
overrides: