Story #12707
closed
[API] Add columns for desired/actual storage classes for each collection
Added by Tom Clegg over 7 years ago.
Updated over 6 years ago.
Estimated time:
(Total: 0.00 h)
Release relationship:
Auto
Description
Similar to replication_* fields:
- storage_classes_desired (jsonb, array of strings, default ["default"])
- storage_classes_confirmed (jsonb, array of strings, default [])
- storage_classes_confirmed_at (timestamp, default null)
Don't include any of these columns in the fulltext index.
- Tracker changed from Bug to Feature
- Blocks Story #12708: [keep-balance] Move blocks to satisfy storage_classes_desired added
- Tracker changed from Feature to Task
- Description updated (diff)
- Description updated (diff)
- Tracker changed from Task to Story
- Story points set to 1.0
- Target version changed from To Be Groomed to 2018-02-28 Sprint
- Assigned To set to Lucas Di Pentima
- Status changed from New to In Progress
For some reason, your structure.sql added "Tablespace" to every comment, what version of Postgres are you using?
(This creates enough noise in the diff I had trouble finding what actually changed)
- -- Name: api_client_authorizations; Type: TABLE; Schema: public; Owner: -
+ -- Name: api_client_authorizations; Type: TABLE; Schema: public; Owner: -; Tablespace:
Rest look good.
- Is one of these redundant? If not, why not?
add_column :collections, :storage_classes_desired, :jsonb, :default => ["default"]
add_column :collections, :storage_classes_confirmed, :jsonb, :default => []
before_validation :default_storage_classes, on: :create
def default_storage_classes
if self.storage_classes_desired.nil? || self.storage_classes_desired.empty?
self.storage_classes_desired = ["default"]
end
self.storage_classes_confirmed ||= []
end
- I don't think we have used jsonb Array columns before (only Hash columns). Can you investigate which Arvados filters work with jsonb Array columns?
- We should probably validate that the elements of storage_classes_desired and storage_classes_confirmed are only non-empty strings.
Lucas Di Pentima wrote:
Updates at 05ececf63
Test run: https://ci.curoverse.com/job/developer-run-tests/620/
Added back the default value setting code on Collection's model as some workbench tests were failing. The default values on the schema will be useful for database migrations with already existing collections.
This LGTM
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Also available in: Atom
PDF