Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

rgw: [CORTX-32688] Enable GC for MOTR #381

Merged
merged 12 commits into from
Aug 12, 2022
Merged

rgw: [CORTX-32688] Enable GC for MOTR #381

merged 12 commits into from
Aug 12, 2022

Conversation

jjxsg
Copy link

@jjxsg jjxsg commented Aug 4, 2022

Implementation of MOTR GC consumer module. The following parameters are honored with GC initialization and processing.

rgw_enable_gc_threads
rgw_gc_max_objs
rgw_gc_obj_min_wait
rgw_gc_processor_max_time
rgw_gc_processor_period
rgw_gc_max_concurrent_io
rgw_gc_max_trim_chunk
GC Deletion Logs
2022-08-12T00:39:02.716-0600 7f6b43380700 10 garbage_collector: [motr_gc_0] entry Iteration Started
2022-08-12T00:39:02.716-0600 7f6b43380700 10 garbage_collector: [motr_gc_0] entry: Working on GC Queue: motr.rgw.gc.0
2022-08-12T00:39:02.716-0600 7f6b43380700 20 index_name_to_motr_fid: id = 0x9b9cb4ceb7e04886:0x5dc34e95934f60ce
2022-08-12T00:39:02.716-0600 7f6b43380700 20 index_name_to_motr_fid: converted id = 0x78000000b7e04886:0x5dc34e95934f60ce
2022-08-12T00:39:02.716-0600 7f6b43380700 20 next_query_by_name: index=motr.rgw.gc.0 keys[0]=1_ prefix=1_ delim=
2022-08-12T00:39:02.724-0600 7f6b43380700 20 next_query_by_name: do_idx_next_op()=1
2022-08-12T00:39:02.724-0600 7f6b43380700  0 garbage_collector: [motr_gc_0] entry: next_query_by_name() rc=1
2022-08-12T00:40:02.725-0600 7f6b43380700 10 garbage_collector: [motr_gc_0] entry Iteration Started
2022-08-12T00:40:02.725-0600 7f6b43380700 10 garbage_collector: [motr_gc_0] entry: Working on GC Queue: motr.rgw.gc.0
2022-08-12T00:40:02.725-0600 7f6b43380700 20 index_name_to_motr_fid: id = 0x9b9cb4ceb7e04886:0x5dc34e95934f60ce
2022-08-12T00:40:02.725-0600 7f6b43380700 20 index_name_to_motr_fid: converted id = 0x78000000b7e04886:0x5dc34e95934f60ce
2022-08-12T00:40:02.725-0600 7f6b43380700 20 next_query_by_name: index=motr.rgw.gc.0 keys[0]=1_ prefix=1_ delim=
2022-08-12T00:40:02.731-0600 7f6b43380700 20 next_query_by_name: do_idx_next_op()=1
2022-08-12T00:40:02.731-0600 7f6b43380700  0 garbage_collector: [motr_gc_0] entry: next_query_by_name() rc=1
2022-08-12T00:40:02.731-0600 7f6b43380700 10 delete_motr_obj_from_gc: deleting motr object oid=18b1158:e014000000300002
2022-08-12T00:40:02.731-0600 7f6b43380700 20 delete_motr_obj_from_gc: m0_entity_delete() rc=0
2022-08-12T00:40:02.741-0600 7f6b43380700 10 delete_motr_obj_from_gc: deleted motr object oid=18b1158:e014000000300002 for tag=lx25891160:lx16146530564033216514
2022-08-12T00:40:02.742-0600 7f6b43380700 20 index_name_to_motr_fid: id = 0x9b9cb4ceb7e04886:0x5dc34e95934f60ce
2022-08-12T00:40:02.742-0600 7f6b43380700 20 index_name_to_motr_fid: converted id = 0x78000000b7e04886:0x5dc34e95934f60ce
2022-08-12T00:40:02.742-0600 7f6b43380700 20 do_idx_op_by_name: op=GET idx=motr.rgw.gc.0 key=0_lx25891160:lx16146530564033216514
2022-08-12T00:40:02.744-0600 7f6b43380700 10 Deleted tag entry 0_lx25891160:lx16146530564033216514
2022-08-12T00:40:02.744-0600 7f6b43380700 20 index_name_to_motr_fid: id = 0x9b9cb4ceb7e04886:0x5dc34e95934f60ce
2022-08-12T00:40:02.744-0600 7f6b43380700 20 index_name_to_motr_fid: converted id = 0x78000000b7e04886:0x5dc34e95934f60ce
2022-08-12T00:40:02.744-0600 7f6b43380700 20 do_idx_op_by_name: op=GET idx=motr.rgw.gc.0 key=1_1660286378
2022-08-12T00:40:02.747-0600 7f6b43380700 10 Deleted time entry 1_1660286378

The following cli command is also enabled for listing objects in GC queue (for dev testing):

bin/radosgw-admin gc list --no-mon-config
Sample GC List Output
$ bin/radosgw-admin gc list --no-mon-config
2022-08-11T23:50:53.288-0600 7fc7d015b680 -1 WARNING: all dangerous and experimental features are enabled.
2022-08-11T23:50:53.288-0600 7fc7d015b680 -1 WARNING: all dangerous and experimental features are enabled.
2022-08-11T23:50:53.289-0600 7fc7d015b680 -1 WARNING: all dangerous and experimental features are enabled.
2022-08-11T23:50:53.289-0600 7fc7d015b680  1 RGW CONF BACKEND STORE = motr
2022-08-11T23:50:53.289-0600 7fc7d015b680  1 RGW BACKEND STORE = motr
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr my endpoint: inet:tcp:10.230.241.24@22501
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr ha endpoint: inet:tcp:10.230.241.24@22001
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr my fid:      0x7200000000000001:0x3
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr profile fid: 0x7000000000000001:0x0
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr addb enabled: 0
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: init flags:       0
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr admin endpoint: inet:tcp:10.230.241.24@22502
2022-08-11T23:50:53.289-0600 7fc7d015b680  0 INFO: motr admin fid:   0x7200000000000001:0x4
[
    {
        "tag": "lx25891160:lx16146530564033216512",
        "name": "testbkt/1M_OBJ\u0007",
        "deletion_time": "1660283421",
        "size": "1048576",
        "size_actual": "1048576"
    },
    {
        "tag": "lx25891160:lx16146530564033216513",
        "name": "testbkt/1M_OBJ\u0007",
        "deletion_time": "1660283449",
        "size": "1048576",
        "size_actual": "1048576"
    }
]

Signed-off-by: Jeet Jain jeet.jain@seagate.com

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

sumedhak27 and others added 4 commits August 3, 2022 10:40
…ra code (#356)

* rgw_sal_motr, motr_gc: [CORTX-33148] add MotrGC, MotrGC::GCWorker infra code

Behaviour
- With Garbage Collector enabled, MotrGC will have GC indexes & GC worker threads.
- GC worker threads will run for the configured max processing time and then
   will wait for the configured time between two consecutive runs.

Additions/Changes
- Add the Garbage Collector infrastructure to support the start & stop of worker threads.
  - MotrGC class with the interfaces to initialize(), start(), stop() and finalize().
  - GCWorker class with entry() and stop() methods.
- Refactor Initialization of MotrStore
  - add setter methods to configure MotrStore
 - add initialize() method to call initialization of all the other components
   eg. MetadataCache, GC, (in future LC, QuotaHandler), etc.

Signed-off-by: Sumedh Anantrao Kulkarni <sumedh.a.kulkarni@seagate.com>
Implement GC metadata structure & corresponding functions

Added motr_gc_obj_info structure to hold gc metadata for an object marked for deletion.
Added logic for creating GC indices based on config parameters.

Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
The GC thread will aquire GC index and process the object entries for
deletion either upto the count governed by "rgw_gc_max_trim_chunk" or
time allowed by "rgw_gc_processor_max_time".

Signed-off-by: Sachin Punadikar <sachin.punadikar@seagate.com>
#373)

* rgw_sal_motr: [CORTX-33691] Defines abstract synchronization primitives
and implements it for Motr GC across multiple RGW instances.

Signed-off-by: Dattaprasad Govekar <dattaprasad.govekar@seagate.com>

* motr_sync_impl: [CORTX-33691] update lock() & remove_lock() methods

Update and refactor the MotrLock::lock() and MotrKVLockProvider::remove_lock()
methods.

Signed-off-by: Sumedh Anantrao Kulkarni <sumedh.a.kulkarni@seagate.com>

Co-authored-by: Dattaprasad Govekar <dattaprasad.govekar@seagate.com>
Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
* rgw_sal_motr, motr_gc: [CORTX-32689] Implement MotrGC::enqueue()

* Push {0_ObjTag: motr_gc_obj_info} and {1_ExpiryTime: motr_gc_obj_info}
  entry to the gc queues, i.e. motr dix.
* Call gc->enqueue() method on simple object delete request without
  actually deleting the obj.

Signed-off-by: Sumedh Anantrao Kulkarni <sumedh.a.kulkarni@seagate.com>

* motr_gc: [CORTX-32689] Implement MotrGC::list() function

MotrGC::list() goes through every gc queue and lists the adds the
pending delete requests in resultant vector.
Interface to list objs using admin tool or rest api's is yet
to be developed.

Signed-off-by: Sumedh Anantrao Kulkarni <sumedh.a.kulkarni@seagate.com>
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@jjxsg jjxsg force-pushed the CORTX-32688 branch 2 times, most recently from fefc513 to 892f8bb Compare August 8, 2022 12:17
src/rgw/motr/gc/gc.cc Outdated Show resolved Hide resolved
@jjxsg jjxsg force-pushed the CORTX-32688 branch 3 times, most recently from d493c8d to b433c2f Compare August 8, 2022 13:46
Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
@jjxsg jjxsg marked this pull request as ready for review August 8, 2022 15:00
@github-actions
Copy link

github-actions bot commented Aug 9, 2022

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

…ke file

Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
src/rgw/rgw_admin.cc Outdated Show resolved Hide resolved
Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
Copy link

@sachinpunadikar sachinpunadikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/rgw/rgw_sal_motr.cc Outdated Show resolved Hide resolved
src/rgw/motr/gc/gc.cc Outdated Show resolved Hide resolved
Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
Copy link

@sachinpunadikar sachinpunadikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sumedhak27 sumedhak27 merged commit e5f5fd7 into Motr_GC Aug 12, 2022
@sumedhak27 sumedhak27 deleted the CORTX-32688 branch August 12, 2022 10:36
shriya-deshmukh pushed a commit to shriya-deshmukh/cortx-rgw that referenced this pull request Aug 19, 2022
Implementation of MOTR GC consumer module. The following parameters are honoured 
with GC initialization and processing. 
```
rgw_enable_gc_threads
rgw_gc_max_objs
rgw_gc_obj_min_wait
rgw_gc_processor_max_time
rgw_gc_processor_period
rgw_gc_max_concurrent_io
rgw_gc_max_trim_chunk
```
The following CLI command is also enabled for listing objects in GC queue (for dev testing):
```
bin/radosgw-admin gc list --no-mon-config
```

Signed-off-by: Jeet Jain <jeet.jain@seagate.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants