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

expireOverflow 删除时的逻辑判断错误 #902

Open
losyn opened this issue Jun 21, 2018 · 1 comment
Open

expireOverflow 删除时的逻辑判断错误 #902

losyn opened this issue Jun 21, 2018 · 1 comment

Comments

@losyn
Copy link

losyn commented Jun 21, 2018

DB.kt 733 — 744 line

//forward modifications to overflow
                val listener = MapModificationListener<K, V> { key, oldVal, newVal, triggered ->
                    if (!triggered && newVal == null && oldVal != null) {
                        //removal, also remove from overflow map
                        val oldVal2 = expireOverflow.remove(key)
                        //@shoud be:   !_valueSerializer.equals(oldVal as V, oldVal2 as V)
                        if (oldVal2 != null && _valueSerializer.equals(oldVal as V, oldVal2 as V)) {
                            Utils.LOG.warning { "Key also removed from overflow Map, but value in overflow Map differs" }
                        }
                    } else if (triggered && newVal == null) {
                        // triggered by eviction, put evicted entry into overflow map
                        expireOverflow.put(key, oldVal)
                    }
                }
@losyn
Copy link
Author

losyn commented Jun 21, 2018

//@shoud be: !_valueSerializer.equals(oldVal as V, oldVal2 as V)
if (oldVal2 != null && _valueSerializer.equals(oldVal as V, oldVal2 as V)) {
Utils.LOG.warning { "Key also removed from overflow Map, but value in overflow Map differs" }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants