Skip to content
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

JSONB, is not being set to its default value #1071

Closed

Conversation

msvinaykumar
Copy link
Contributor

The potential issue is that after an increase in database size, the DataSource column, which is of type JSONB, is not being set to its default value. However, it allows for this if we perform a database cleanup. Therefore, the solution is to set the default value of the JSONB-type column to null.

created issue for same

#1065

@msvinaykumar msvinaykumar added the bug Something isn't working label Dec 4, 2023
@msvinaykumar msvinaykumar added this to the Kruize 0.0.20_rm Release milestone Dec 4, 2023
@msvinaykumar msvinaykumar self-assigned this Dec 4, 2023
@msvinaykumar
Copy link
Contributor Author

@chandrams this issue not able to reproduce locally as it requires DB size increase to existing DB without clean up command.

create table IF NOT EXISTS kruize_recommendations (interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255), extended_data jsonb, version varchar(255), primary key (experiment_name, interval_end_time)) PARTITION BY RANGE (interval_end_time);
create table IF NOT EXISTS kruize_results (interval_start_time timestamp(6) not null, interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255) , duration_minutes float(53) not null, extended_data jsonb, meta_data jsonb, version varchar(255), primary key (experiment_name, interval_end_time, interval_start_time)) PARTITION BY RANGE (interval_end_time);
create table IF NOT EXISTS kruize_recommendations (interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255), extended_data jsonb , version varchar(255), primary key (experiment_name, interval_end_time)) PARTITION BY RANGE (interval_end_time);
create table IF NOT EXISTS kruize_results (interval_start_time timestamp(6) not null, interval_end_time timestamp(6) not null, experiment_name varchar(255) not null, cluster_name varchar(255) , duration_minutes float(53) not null, extended_data jsonb, meta_data jsonb DEFAULT NULL, version varchar(255), primary key (experiment_name, interval_end_time, interval_start_time)) PARTITION BY RANGE (interval_end_time);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to set DEFAULT NULL or extended_data jsonb as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no extended_data cannot be set DEFAULT NULL, It should have values always.

Copy link
Contributor

@chandrams chandrams left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -312,6 +314,7 @@ public static KruizeResultsEntry convertExperimentResultToExperimentResultsTable
Double.valueOf((experimentResultData.getIntervalEndTime().getTime() -
experimentResultData.getIntervalStartTime().getTime()) / (60 * 1000))
);
kruizeResultsEntry.setMeta_data(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check datasource here and set it to null if the user has not set it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, however, the 'datasource' element has not been implemented at the code level; it was only conceptualized during the design phase. To verify the existence of the datasource, we would need to declare that variable in the API object and handle JSON parsing accordingly. All these modifications can be implemented once the datasource is active. Currently, we have chosen to minimize changes to focus on bug fixes.

@msvinaykumar
Copy link
Contributor Author

merged into MVP
#1085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working remote_monitoring
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants