What is the bitmap's meaning in mdstat

4,598

The bitmap line in /proc/mdstat indicates how much memory is being used to cache the write-intent bitmap.

Basically, in RAID setups with redundant devices, mdadm can use a "bitmap" to keep track of which blocks may be out of sync (because they've been written to). When a block is written to the mdadm device, it is flagged in the bitmap, and then written to the underlying devices; once enough time has passed without activity in the block that mdadm can be sure that it's been written to all the devices, the flag is removed from the bitmap. It's useful to speed up resyncs after a system crash, or after a disk is removed and re-added (without being changed).

In your case, 0/8 means that no memory is being used for the in-memory bitmap cache. This is a good thing: there's a good chance that all the underlying devices are synced. (In theory there could be entries in the on-disk bitmap that aren't cached in memory, but that's unlikely if the cache is completely empty.)

md(4) has more information.

Share:
4,598

Related videos on Youtube

gstackoverflow
Author by

gstackoverflow

Updated on September 18, 2022

Comments

  • gstackoverflow
    gstackoverflow over 1 year

    I have following web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app
            version="3.0"
            xmlns="http://java.sun.com/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="
            http://java.sun.com/xml/ns/javaee
            http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd
            ">
    
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    
        <listener>
            <listener-class>
                org.springframework.web.context.request.RequestContextListener
            </listener-class>
        </listener>
    
        ...
        <listener>
            <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
        </listener>
    
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>WEB-INF/applicationContext.xml</param-value>
        </context-param>
        ...
    
        <!-- Spring MVC -->
        <servlet>
            <servlet-name>appServlet</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>WEB-INF/webContext.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>appServlet</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    </web-app>
    

    Thus from web.xml I load two configuration files:

    applicationContext.xml and webContext.xml

    I copied these files to resources/META-INF and write integration test with following signature:

    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(locations = {"classpath:META-INF/applicationContext.xml", "classpath:META-INF/webContext.xml"})
    public class OwnerTerminalsControllerTest {
    

    when I try to execute any method from test I see error like this:

         org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'conversionService' defined in class path resource [META-INF/webContext.xml]: Cannot resolve reference to bean 'terminalGroupFormatter' while setting bean property 'formatters' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'terminalGroupFormatter': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.terminal.dao.TerminalGroupDao com.terminal.formatter.TerminalGroupFormatter.terminalGroupDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'terminalGroupDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.terminal.dao.impl.TerminalGroupDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.hibernate.SessionFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
    
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.hibernate.SessionFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
        ... 70 more
    24.09.2015 12:28:49 ERROR: org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@7181ae3f] to prepare test instance [com.terminal.controller.owner.OwnerTerminalsControllerTest@6bc248ed]
    java.lang.IllegalStateException: Failed to load ApplicationContext
        at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
        .....
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.hibernate.SessionFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
        ... 70 more
    

    For me two configurations looks same and I have not ideas why from test context cannon be loaded

    P.S.

    inside applicatioContext I have following lines:

    <import resource="classpath:META-INF/dataContext.xml"/>
    <import resource="classpath:META-INF/restTemplateContext.xml" />
    <import resource="classpath:META-INF/securityContext.xml"/>
    

    dataContext:

    <beans
            xmlns="http://www.springframework.org/schema/beans"
            xmlns:p="http://www.springframework.org/schema/p"
            xmlns:context="http://www.springframework.org/schema/context"
            xmlns:tx="http://www.springframework.org/schema/tx"
            xmlns:jdbc="http://www.springframework.org/schema/jdbc"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:task="http://www.springframework.org/schema/task"
            xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/tx
            http://www.springframework.org/schema/tx/spring-tx.xsd
            http://www.springframework.org/schema/jdbc
            http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
    
             http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
    
        <tx:annotation-driven transaction-manager="transactionManager"/>
    
        <context:component-scan base-package="com.terminal.domain, com.terminal.dao, com.terminal.utils"/>
    
        <bean id="transactionManager"
              class="org.springframework.orm.hibernate4.HibernateTransactionManager">
            <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
    
        <bean id="messageSource"
              class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basenames">
                <list>
                    <value>mymessages</value>
                </list>
            </property>
        </bean>
    
        <task:scheduler id="jobScheduler" pool-size="10"/>
    
        <beans profile="test">
    
            <bean id="wrappedDataSource" class="net.bull.javamelody.SpringDataSourceFactoryBean">
                <property name="targetName" value="dataSource" />
            </bean>
    
            <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
                <property name="driverClassName" value="org.h2.Driver" />
                <property name="url" value="jdbc:h2:~/test;MODE=PostgreSQL" />
                <property name="username" value="sa" />
                <property name="password" value="" />
            </bean>
    
            <bean id="sessionFactory"
                  class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
                <property name="dataSource" ref="wrappedDataSource"/>
                <property name="configLocation">
                    <value>classpath:hibernate-test.cfg.xml</value>
                </property>
                <property name="hibernateProperties">
                    <props>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.connection.charSet">UTF-8</prop>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.format_sql">true</prop>
                        <prop key="hbm2ddl.auto">create-drop</prop>
                    </props>
                </property>
            </bean>
    
            <context:property-placeholder location="classpath:jdbc.properties"/>
    
        </beans>
        <beans profile="dev">
    
            <bean id="wrappedDataSource" class="net.bull.javamelody.SpringDataSourceFactoryBean">
                <property name="targetName" value="dataSource" />
            </bean>
    
            <bean id="sessionFactory"
                  class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
                <property name="dataSource" ref="wrappedDataSource"/>
                <property name="configLocation">
                    <value>classpath:hibernate.cfg.xml</value>
                </property>
                <property name="hibernateProperties">
                    <props>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.dialect">${jdbc.dialect}</prop>
                        <prop key="hibernate.connection.charSet">UTF-8</prop>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.format_sql">true</prop>
                        <prop key="hbm2ddl.auto">validate</prop>
                    </props>
                </property>
            </bean>
    
            <context:property-placeholder location="classpath:jdbc-local.properties"/>
            <bean id="dataSource"
                  class="org.springframework.jdbc.datasource.DriverManagerDataSource"
                  p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.databaseurl}"
                  p:username="${jdbc.username}" p:password="${jdbc.password}"/>
        </beans>
        <beans profile="prod">
    
            <bean id="wrappedDataSource" class="net.bull.javamelody.SpringDataSourceFactoryBean">
                <property name="targetName" value="dataSource" />
            </bean>
    
            <bean id="sessionFactory"
                  class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
                <property name="dataSource" ref="wrappedDataSource"/>
                <property name="configLocation">
                    <value>classpath:hibernate.cfg.xml</value>
                </property>
                <property name="hibernateProperties">
                    <props>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.dialect">${jdbc.dialect}</prop>
                        <prop key="hibernate.connection.charSet">UTF-8</prop>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.format_sql">true</prop>
                        <prop key="hbm2ddl.auto">validate</prop>
                    </props>
                </property>
            </bean>
    
            <context:property-placeholder location="classpath:jdbc.properties"/>
            <bean id="dataSource"
                  class="org.springframework.jdbc.datasource.DriverManagerDataSource"
                  p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.databaseurl}"
                  p:username="${jdbc.username}" p:password="${jdbc.password}"/>
        </beans>
    </beans>
    
    • Serge Ballesta
      Serge Ballesta over 8 years
      The cause of the error seems to be a non existent SessionFactory bean. How do you declare the database in applicationContext.xml?
    • gstackoverflow
      gstackoverflow over 8 years
      @Serge Ballesta topic updated
  • gstackoverflow
    gstackoverflow over 8 years
    Yes this problem fixed)