You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kudu.apache.org by "Adar Dembo (JIRA)" <ji...@apache.org> on 2016/09/03 02:16:20 UTC
[jira] [Commented] (KUDU-1590) cache-test failing on my laptop
[ https://issues.apache.org/jira/browse/KUDU-1590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15460155#comment-15460155 ]
Adar Dembo commented on KUDU-1590:
----------------------------------
One other thing: I thought this might have been due to std::string refcounting issues, so I applied the following patch:
{noformat}
diff --git a/src/kudu/util/cache-test.cc b/src/kudu/util/cache-test.cc
index c49d077..a6d79a7 100644
--- a/src/kudu/util/cache-test.cc
+++ b/src/kudu/util/cache-test.cc
@@ -73,7 +73,8 @@ class CacheTest : public KuduTest,
}
int Lookup(int key) {
- Cache::Handle* handle = cache_->Lookup(EncodeInt(key), Cache::EXPECT_IN_CACHE);
+ string key_str = EncodeInt(key);
+ Cache::Handle* handle = cache_->Lookup(key_str, Cache::EXPECT_IN_CACHE);
const int r = (handle == nullptr) ? -1 : DecodeInt(cache_->Value(handle));
if (handle != nullptr) {
cache_->Release(handle);
@@ -91,7 +92,8 @@ class CacheTest : public KuduTest,
}
void Erase(int key) {
- cache_->Erase(EncodeInt(key));
+ string key_str = EncodeInt(key);
+ cache_->Erase(key_str);
}
};
@@ -155,11 +157,12 @@ TEST_P(CacheTest, Erase) {
TEST_P(CacheTest, EntriesArePinned) {
Insert(100, 101);
- Cache::Handle* h1 = cache_->Lookup(EncodeInt(100), Cache::EXPECT_IN_CACHE);
+ string key_str = EncodeInt(100);
+ Cache::Handle* h1 = cache_->Lookup(key_str, Cache::EXPECT_IN_CACHE);
ASSERT_EQ(101, DecodeInt(cache_->Value(h1)));
Insert(100, 102);
- Cache::Handle* h2 = cache_->Lookup(EncodeInt(100), Cache::EXPECT_IN_CACHE);
+ Cache::Handle* h2 = cache_->Lookup(key_str, Cache::EXPECT_IN_CACHE);
ASSERT_EQ(102, DecodeInt(cache_->Value(h2)));
ASSERT_EQ(0, evicted_keys_.size());
{noformat}
It didn't help, but it might be worth applying in any case; I can't remember the rules about creating temporary Slices on temporary strings.
> cache-test failing on my laptop
> -------------------------------
>
> Key: KUDU-1590
> URL: https://issues.apache.org/jira/browse/KUDU-1590
> Project: Kudu
> Issue Type: Bug
> Components: test
> Affects Versions: 1.0.0
> Reporter: Adar Dembo
> Assignee: Todd Lipcon
> Priority: Blocker
>
> Here's the failure:
> {noformat}
> [ RUN ] CacheTypes/CacheTest.EvictionPolicy/0
> /home/adar/Source/kudu/src/kudu/util/cache-test.cc:198: Failure
> Value of: Lookup(200)
> Actual: 201
> Expected: -1
> I0902 19:07:59.004560 25663 test_util.cc:78] -----------------------------------------------
> I0902 19:07:59.004580 25663 test_util.cc:79] Had fatal failures, leaving test files at /tmp/kudutest-1000/cache-test.CacheTypes_CacheTest.EvictionPolicy_0.1472868478986786-25663
> [ FAILED ] CacheTypes/CacheTest.EvictionPolicy/0, where GetParam() = 0 (6 ms)
> {noformat}
> I suspect this is due to commit bfb6f23, but I don't know how. Amusingly, CacheTest.EvictionPolicy/1 (for NVM_CACHE) is passing.
> Here's what I know:
> * I was working on upgrading to LLVM 3.9 when I noticed this. I rolled back to LLVM 3.8 and the problem persisted, so I suspect it has nothing to do with the LLVM upgrade.
> * I can't repro it on ve0518 normally.
> * But if I replace the call to base::NumCPUs() in cache.cc with 8 (the number of cores on my laptop), it reproduces in the exact same way on ve0518.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)