-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve modularity of some per-table API endpoints #18703
Improve modularity of some per-table API endpoints #18703
Conversation
#include "column_family.hh" | ||
#include "api/api.hh" | ||
#include "api/api-doc/column_family.json.hh" | ||
#include "api/api-doc/storage_service.json.hh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, these endpoints are still live under /storage_service/
prefix, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the path they are visible under is not changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denesb , does your concern still stand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping related code together is more important than repeating the mistake of the API endpoint placement.
🔴 CI State: FAILURE✅ - Build Failed Tests (27/31061):
Build Details:
|
On stop all endpoints must be unregistered, these three are lost Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
The (enable|disable)_(tombstone_gc|auto_compaction) endpoints living in column_family domain can benefit from the helpers that do the same in the storage_service domain. The "difference" is that c.f. endpoints do it per-table, while s.s. ones operate on a vector of tables, so the former is a corner case of the latter. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
The storage_service/(enable|disable)_(tombstone_gc|auto_compaction) endpoints are not handled by storage_service _service_ and should rather live in the column_family/ domain which is handler by replica::database. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
Continuation of the previous patch -- helpers toggling tombstone_gc and auto_compaction on tables should live in the same file that uses them. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
Toggling per-table auto-compaction enabling bit is guarded with on-database boolean and raii guard. It's only used by a single api/column_family.cc file, so it can live there. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
6771616
to
31d0592
Compare
upd:
|
🟢 CI State: SUCCESS✅ - Build Build Details:
|
There's a set of API endpoints that toggle per-table auto-compaction and tombstone-gc booleans. They all live in two different .cc files under api/ directory and duplicate code of each other. This PR generalizes those handlers, places them next to each other, fixes leak on stop and, as a nice side effect, enlightens database.hh header.