Hi,
sorry for the delay, but I have some other tasks on my shoulders and after we went to production, we've suffered from some new issues with hz4.
The new issue came up after we added custom serialization and the application didnt die in few minutes/hours,
but it was our bug (which didn't affect hz3 though) - we sometimes didnt unlock the key on cache after trylock.
I have run some tests on my test env. Test env consists of 4 servers clustered by hz. Scenario is simulation of users logging.
At the beginning cache is empty (bigger times at the beginning of each run) but because I have limited number of users,
as their data is stored in the cache, times are getting better after next logging of the same user.
This is the cache:
Map<Key, TreeMap<Long, AnObject>>
Key is a class with 2 string fields, long field and an enum field.
TreeMap Value is quite big object:
public class AnObject implements Serializable, Comparable<AnObject>, SomeInterface {
private static final long serialVersionUID = someLongVal;
private Long aLongField1;
private Long aLongField2;
private Long aLongField3;
private Long aLongField4;
private Long aLongField5;
private LocalDateTime aLocalDateTimeField1;
private LocalDateTime aLocalDateTimeField2;
private Enum1 anEnumField1;
private String aStringField1;
private Enum2 anEnumField2;
private BigDecimal aBigDecimalField1;
private BigDecimal aBigDecimalField2;
private String aStringField2;
private BigDecimal aBigDecimalField3;
private String aStringField3;
private AnObject2 anObjectField1; //simple 4 String field object
private String aStringField4;
private AnObject2 anObjectField2; //simple 4 String field object
private AnObject2 anObjectField3; //simple 4 String field object
private String aStringField5;
private BigDecimal aBigDecimalField4;
private Long aLongField6;
private String aStringField6;
private String aStringField7;
private Long aLongField7;
private Long aLongField8;
private Long aLongField9;
private List<AnObject> anObjectField4; //AnObject of the same type as this class(!!!)
private Set<AnObject3> anObjectField5; //a bit more complex - it consists fields SomeClass(with 3 simple fields), 4 long fields, 1 enum, 1 BigDecimal, 3 string fields
private Boolean aBooleanField1;
private Long aLongField10;
}
To sum up, the screen below shows tests results. It shows times of cache operations (except the green line): get, putAll, getLastUpdateTime (from entryView).
Hz4 with custom serialization has the lowest possible times now, probably mostly the network time is what we see.
Hz4 without custom serialization but simplified the field anObjectField4 - I have made a list of Strings out of it temporarily
because I thought that maybe it was the issue for the serializer to serialize field of the Object which was the same type
as the Class the field was in, but as we can see, its just slightly better than next test run.
Hz4 without custom serialization and without simplification is what have killed us after switching from hz3
(note the times at the beginning, when the cache is empty - its very high for new values)
Hz3 without custom serialization has slightly worse times than hz4 with custom serialization, but it was just fine.
Hz4 with custom serialization and simplified value (anObjectField4) made no big difference for first test run, as the times there are already minimal.
Unfortunately I couldnt find anything suspicious while debugging but after fixing serialization and not-unlocked-tryLock issue, we are now running smoothly.
regards
Marcin Mikołajczyk