I am trying to build Couchbase server on s390x architecture (RHEL7/SLES12). After successful build, when I ran the test cases, following test cases failed for s390x:
-
bcache_test
-
atomic_test
-
filemgr_test
-
btreeblock_test
-
docio_test
-
hbtrie_test
-
crc_test
-
btree_str_kv_test
-
btree_kv_test
- fdb_functional_test
- fdb_extended_test
- compact_functional_test
- iterator_functional_test
- mvcc_functional_test
- multi_kv_functional_test
- fdb_anomaly_test
I made following change in the code to make 16 test cases pass:
bash-4.2# diff ./forestdb/src/arch.h_ORIG ./forestdb/src/arch.h
236a237,240
#if defined(s390x)
#undef SPIN_INITIALIZER
#define SPIN_INITIALIZER (spin_t)(0)
#endif
The above code change is required because older code was setting SPIN_INITIALIZER value to 1. This was causing ‘spin_lock’ to wait infinitely for spin lock which is not acquired by any
other thread (it’s just the lock is initialized with wrong value). Adding a check – “#if defined _s390x)” will make sure that the functionality doesn’t get changed for other architectures.