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

6.2 upgrade checklist #37

Closed
24 of 32 tasks
ajkr opened this issue Jun 26, 2019 · 13 comments
Closed
24 of 32 tasks

6.2 upgrade checklist #37

ajkr opened this issue Jun 26, 2019 · 13 comments

Comments

@ajkr
Copy link

ajkr commented Jun 26, 2019

checklist generation command:

git log --no-decorate v5.17.2..origin/crl-release-5.17.2 --pretty=oneline | tac | awk '{print "- [ ] **" $0 "**"}'

branch: https://github.com/cockroachdb/rocksdb/tree/crl-release-6.2.1

checklist:

@ajkr
Copy link
Author

ajkr commented Jun 27, 2019

I marked the optimization to skip over sstables that are fully covered by range tombstones as dropped due to time constraints. I wasn't able to come up with a clean implementation of ShouldDeleteRange in the new RangeDelAggregator implementation (it is removed in the upstream PR). We can revisit it later with more time and ideas.

@petermattis
Copy link

I marked the optimization to skip over sstables that are fully covered by range tombstones as dropped due to time constraints. I wasn't able to come up with a clean implementation of ShouldDeleteRange in the new RangeDelAggregator implementation (it is removed in the upstream PR). We can revisit it later with more time and ideas.

Ack. Ok.

@ajkr
Copy link
Author

ajkr commented Jun 27, 2019

I was able to compile on Mac without feeaa41. Not sure what to do with it - maybe try dropping it and see if anyone else's build breaks? It is hard to submit upstream right now since I can't say what it fixes.

@benesch
Copy link

benesch commented Jun 27, 2019 via email

@ajkr
Copy link
Author

ajkr commented Jun 27, 2019

Thanks Nikhil :). It did appear to successfully link the cockroach binary. I could have made a mistake or could have been using different dependency versions (I was running on qemu on Linux as I don't have a real Mac). Let me try soliciting someone who actually uses Mac to help test.

@benesch
Copy link

benesch commented Jun 27, 2019

Ah, gotcha. So if, using the current master, I run cd c-deps/rocksdb && git revert feeaa41120ef && cd ../.. && make build, I do see an error like:

/Users/benesch/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/malloc_stats.cc:53:3: error: use
      of undeclared identifier 'malloc_stats_print'; did you mean 'je_malloc_stats_print'?
  malloc_stats_print(GetJemallocStatus, &mstat, "");
  ^~~~~~~~~~~~~~~~~~
  je_malloc_stats_print
/Users/benesch/go/native/x86_64-apple-darwin18.6.0/jemalloc/include/jemalloc/jemalloc.h:235:39: note: 
      'je_malloc_stats_print' declared here
JEMALLOC_EXPORT void JEMALLOC_NOTHROW   je_malloc_stats_print(
                                        ^
/Users/benesch/go/native/x86_64-apple-darwin18.6.0/jemalloc/include/jemalloc/jemalloc.h:77:33: note: 
      expanded from macro 'je_malloc_stats_print'
#  define je_malloc_stats_print je_malloc_stats_print
                                ^
1 error generated.
make[4]: *** [CMakeFiles/rocksdb.dir/db/malloc_stats.cc.o] Error 1
make[3]: *** [CMakeFiles/rocksdb.dir/all] Error 2
make[2]: *** [CMakeFiles/rocksdb.dir/rule] Error 2
make[1]: *** [rocksdb] Error 2
make: *** [/Users/benesch/go/native/x86_64-apple-darwin18.6.0/rocksdb/librocksdb.a] Error 2

But perhaps that's been fixed somehow in RocksDB 6.2!

@ajkr
Copy link
Author

ajkr commented Jun 27, 2019

I see. Thanks for the build output. The candidate 6.2 release branch is here if you want to try: https://github.com/cockroachdb/rocksdb/tree/crl-release-6.2.1

@benesch
Copy link

benesch commented Jun 27, 2019 via email

@ajkr
Copy link
Author

ajkr commented Jun 27, 2019

Oh really? Do you mind sharing the compiler error? I am building cockroach master branch against that rocksdb 6.2 branch and it seems to work.

@ajkr
Copy link
Author

ajkr commented Jun 27, 2019

Never mind. TIL make clean followed by make resets the submodules. cockroachdb/cockroach#38528

@benesch
Copy link

benesch commented Jun 28, 2019

Never mind. TIL make clean followed by make resets the submodules.

D'oh. Perhaps the rule for deleting bin/.submodules-initialized should be moved to make unsafe-clean to prevent the pitfall.

So your patch fixes the libroach compilation failure—thanks! I tested building the latest master with RocksDB pointed at crl-release-6.2.1 and got a jemalloc related error:

  "_dallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_mallctl", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_mallctlbymib", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_mallctlnametomib", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_malloc_stats_print", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_malloc_usable_size", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_mallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_nallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_rallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_sallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_sdallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)
  "_xallocx", referenced from:
      rocksdb::DumpMallocStats(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in librocksdb.a(malloc_stats.cc.o)

That error is indeed resolved by adding feeaa41 to the RocksDB submodule, albeit a bit modified for some upstream changes:

diff --git a/db/malloc_stats.cc b/db/malloc_stats.cc
index bcee5c3fb..1dfe0d55b 100644
--- a/db/malloc_stats.cc
+++ b/db/malloc_stats.cc
@@ -20,10 +20,6 @@ namespace rocksdb {
 
 #ifdef ROCKSDB_JEMALLOC
 
-#ifdef JEMALLOC_NO_RENAME
-#define malloc_stats_print je_malloc_stats_print
-#endif
-
 typedef struct {
   char* cur;
   char* end;
diff --git a/port/jemalloc_helper.h b/port/jemalloc_helper.h
index 0c216face..e5472ff70 100644
--- a/port/jemalloc_helper.h
+++ b/port/jemalloc_helper.h
@@ -9,6 +9,7 @@
 #ifdef __FreeBSD__
 #include <malloc_np.h>
 #else
+#define JEMALLOC_MANGLE
 #include <jemalloc/jemalloc.h>
 #endif

The rationale, if you're interested in upstreaming this patch, is that the current RocksDB code is broken when linking against a jemalloc that's been configured with a non-empty --with-jemalloc-prefix option. (In other words, I can reproduce when building using RocksDB's upstream build system, outside of cockroach, when linking against a jemalloc built with --with-jemalloc-prefix=_je.) The reason this doesn't come up in practice is because apparently nobody sets --with-jemalloc-prefix but us. We don't do it intentionally, but by default jemalloc's configure sets --with-jemalloc-prefix=je_ on macOS. Homebrew and MacPorts both override it back to the empty string (more context: Homebrew/homebrew-core#7488), which is why no one notices, I guess.

Anyway, it seems like it's worth working with jemallocs that have been built with --with-jemalloc-prefix=foo, and the patch above makes RocksDB link against jemallocs with/without prefixes. Hopefully upstream agrees. :)

@ajkr
Copy link
Author

ajkr commented Jun 28, 2019

Understood, thanks a lot for your help! Will submit upstream.

@benesch
Copy link

benesch commented Jun 28, 2019

Heh, thanks for doing all the heavy lifting!

ajkr added a commit to ajkr/cockroach that referenced this issue Jul 1, 2019
craig bot pushed a commit to cockroachdb/cockroach that referenced this issue Jul 1, 2019
38576: c-deps: upgrade rocksdb to 6.2.1 r=ajkr a=ajkr

Release branch: https://github.com/cockroachdb/rocksdb/tree/crl-release-6.2.1

See checklist: cockroachdb/rocksdb#37

Fixes #37602

Release note: None

Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
ajkr added a commit to ajkr/cockroach that referenced this issue Jul 9, 2019
craig bot pushed a commit to cockroachdb/cockroach that referenced this issue Jul 10, 2019
38781: c-deps: upgrade rocksdb to 6.2.1 r=ajkr a=ajkr

This is a resubmission of c505411 which got accidentally reverted in f8aaa90.

Release branch: https://github.com/cockroachdb/rocksdb/tree/crl-release-6.2.1

Checklist: cockroachdb/rocksdb#37

Fixes #37602

Release note: None

Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
@ajkr ajkr closed this as completed Jul 11, 2019
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

No branches or pull requests

3 participants