Skip to content

Conversation

Mmuzaf
Copy link
Contributor

@Mmuzaf Mmuzaf commented May 14, 2023

Thanks for sending a pull request! Here are some tips if you're new here:

  • Ensure you have added or run the appropriate tests for your PR.
  • Be sure to keep the PR description updated to reflect all changes.
  • Write your PR title to summarize what this PR proposes.
  • If possible, provide a concise example to reproduce the issue for a faster review.
  • Read our contributor guidelines
  • If you're making a documentation change, see our guide to documentation contribution

Commit messages should follow the following format:

<One sentence description, usually Jira title or CHANGES.txt summary>

<Optional lengthier description (context on patch)>

patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####

Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>

The Cassandra Jira

@@ -204,6 +205,8 @@ public MemtableOptions()
// Limit the maximum depth of repair session merkle trees
@Deprecated
public volatile Integer repair_session_max_tree_depth = null;
@Mutable
@Validate(useClass = DATABASE_DESCRIPTOR_CLASS, useClassMethod = "validateRepairSessionSpace")
Copy link
Contributor

Choose a reason for hiding this comment

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

do you do string because Class<DatabaseDescriptor> would cause a circular ref?

* a custom validator class and its method.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
Copy link
Contributor

Choose a reason for hiding this comment

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

for now this is fine, if we need to can allow in method later, just need to update the loader

@Mmuzaf
Copy link
Contributor Author

Mmuzaf commented Jul 3, 2023

@smiklosovic Thank you for the comments.
Do you agree with the proposed solution design? Do you have any comments on that?

@smiklosovic
Copy link
Contributor

smiklosovic commented Jul 3, 2023

@Mmuzaf I think you did a good job and David already saw it too so ... I may go through it next days again but seems robust enough to me! It would be nice to have yet another pair of eyes on this, if you happen to get somebody to take a look, that would be great!

try
{
Object value = getPropertyAsString(getKeyAndWarnIfObsolete(name));
result.row(name).column(VALUE, value).column(MUTABLE, DatabaseDescriptor.isMutableProperty(name));
Copy link
Contributor

@smiklosovic smiklosovic Sep 4, 2023

Choose a reason for hiding this comment

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

@Mmuzaf I was thinking about this some time ago and I found some time to go over this again ... I think that isMutableProperty is too much here in such sense that it might be "cached". We are not going to introduce a new property while a node is running - it is a static set of keys and values. You can populate a map in a constructor of vtable. So it would be just a simple map lookup, or even easier, names of all mutable properties would be in a set. So if it is not in s set it is not mutable. You do not need to do reflection every single query for every single property all over again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smiklosovic agree, this makes sense to me. I'll try to figure out the best way to avoid using reflection every time we need to get the mutability state.

@dcapwell
Copy link
Contributor

Sorry, been away from this patch for a very long time. If 2 committers are +1 to this patch please don't wait for me and feel free to merge. I don't know when I will have time to review again.

.build());
this.config = config;
for (String name : BACKWARDS_COMPATABLE_NAMES.keySet())
Copy link
Contributor

Choose a reason for hiding this comment

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

@Mmuzaf COMPATIBLE, not COMPATABLE

private void handleResizeIntervalInMinutes(DurationSpec.IntMinutesBound oldValue, DurationSpec.IntMinutesBound newValue)
{
int oldInterval = getDurationInMinutes(oldValue);
int resizeIntervalInMinutes = getDurationInMinutes(newValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Mmuzaf where was this property taken from before? I see it is already used in this method further down bellow ...

@@ -296,6 +318,7 @@ public void shutdownAndWait(long timeout, TimeUnit unit) throws InterruptedExcep
future.cancel(false);
future = null;
}
shutdownTasks.forEach(Runnable::run);
Copy link
Contributor

Choose a reason for hiding this comment

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

what if Runnable#run throws? Then it will never get to ExecutorUtils.shutdownAndWait on the next line?

}

@Test
public void testBactchUpdateSettings() throws Throwable
Copy link
Contributor

Choose a reason for hiding this comment

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

testBatch...

protected static final Map<String, Property> PROPERTIES = ImmutableMap.copyOf(getProperties());

private final Config config;
private static final String MUTABLE = "is_mutable";
Copy link
Contributor

Choose a reason for hiding this comment

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

@Mmuzaf can be this renamed just to mutable? I think that is just enough ... no need to put there is_.

validatedByArray = new ValidatedBy[]{ field.getAnnotation(ValidatedBy.class) };
}
else
validatedByArray = validatedByList.value();
Copy link
Contributor

@smiklosovic smiklosovic Dec 19, 2023

Choose a reason for hiding this comment

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

@Mmuzaf could it happen that validatedByList would not be null but the array would be null? Then the next for would loop over null?

@belliottsmith belliottsmith force-pushed the trunk branch 2 times, most recently from df3eb40 to 54e39a9 Compare July 23, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants